forked from bit/DotRecastNetSim
adding obstacle tool
This commit is contained in:
parent
12dfb27538
commit
b115f816b4
|
@ -383,6 +383,7 @@ public class RecastDemo : IRecastDemoChannel
|
|||
toolset = new RcToolsetView(
|
||||
new TestNavmeshTool(),
|
||||
new TileTool(),
|
||||
new ObstacleTool(),
|
||||
new OffMeshConnectionTool(),
|
||||
new ConvexVolumeTool(),
|
||||
new CrowdTool(),
|
||||
|
|
|
@ -28,14 +28,9 @@ public interface IRcTool
|
|||
{
|
||||
ISampleTool GetTool();
|
||||
void OnSampleChanged();
|
||||
|
||||
void Layout();
|
||||
|
||||
void HandleClick(RcVec3f s, RcVec3f p, bool shift);
|
||||
|
||||
void HandleRender(NavMeshRenderer renderer);
|
||||
|
||||
void HandleUpdate(float dt);
|
||||
|
||||
void HandleClickRay(RcVec3f start, RcVec3f direction, bool shift);
|
||||
}
|
|
@ -0,0 +1,47 @@
|
|||
using DotRecast.Core;
|
||||
using DotRecast.Recast.Demo.Draw;
|
||||
using DotRecast.Recast.DemoTool;
|
||||
using DotRecast.Recast.DemoTool.Tools;
|
||||
using Serilog;
|
||||
|
||||
namespace DotRecast.Recast.Demo.Tools;
|
||||
|
||||
public class ObstacleTool : IRcTool
|
||||
{
|
||||
private static readonly ILogger Logger = Log.ForContext<ObstacleTool>();
|
||||
private readonly ObstacleToolImpl _impl;
|
||||
|
||||
public ObstacleTool()
|
||||
{
|
||||
_impl = new();
|
||||
}
|
||||
|
||||
public ISampleTool GetTool()
|
||||
{
|
||||
return _impl;
|
||||
}
|
||||
|
||||
public void OnSampleChanged()
|
||||
{
|
||||
}
|
||||
|
||||
public void Layout()
|
||||
{
|
||||
}
|
||||
|
||||
public void HandleClick(RcVec3f s, RcVec3f p, bool shift)
|
||||
{
|
||||
}
|
||||
|
||||
public void HandleRender(NavMeshRenderer renderer)
|
||||
{
|
||||
}
|
||||
|
||||
public void HandleUpdate(float dt)
|
||||
{
|
||||
}
|
||||
|
||||
public void HandleClickRay(RcVec3f start, RcVec3f direction, bool shift)
|
||||
{
|
||||
}
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
namespace DotRecast.Recast.DemoTool.Tools
|
||||
{
|
||||
public class ObstacleToolImpl : ISampleTool
|
||||
{
|
||||
private Sample _sample;
|
||||
|
||||
public string GetName()
|
||||
{
|
||||
return "Create Temp Obstacles";
|
||||
}
|
||||
|
||||
public void SetSample(Sample sample)
|
||||
{
|
||||
_sample = sample;
|
||||
}
|
||||
|
||||
public Sample GetSample()
|
||||
{
|
||||
return _sample;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue