forked from bit/DotRecastNetSim
refactor: ObstacleSampleTool
This commit is contained in:
parent
122239030a
commit
8d6c693e05
|
@ -14,10 +14,7 @@ public class ObstacleSampleTool : ISampleTool
|
||||||
private static readonly ILogger Logger = Log.ForContext<ObstacleSampleTool>();
|
private static readonly ILogger Logger = Log.ForContext<ObstacleSampleTool>();
|
||||||
|
|
||||||
private DemoSample _sample;
|
private DemoSample _sample;
|
||||||
|
|
||||||
private readonly RcObstacleTool _tool;
|
private readonly RcObstacleTool _tool;
|
||||||
private bool _hitPosSet;
|
|
||||||
private RcVec3f _hitPos;
|
|
||||||
|
|
||||||
public ObstacleSampleTool()
|
public ObstacleSampleTool()
|
||||||
{
|
{
|
||||||
|
@ -103,16 +100,13 @@ public class ObstacleSampleTool : ISampleTool
|
||||||
|
|
||||||
public void HandleClick(RcVec3f s, RcVec3f p, bool shift)
|
public void HandleClick(RcVec3f s, RcVec3f p, bool shift)
|
||||||
{
|
{
|
||||||
_hitPosSet = true;
|
|
||||||
_hitPos = p;
|
|
||||||
|
|
||||||
if (shift)
|
if (shift)
|
||||||
{
|
{
|
||||||
_tool.RemoveTempObstacle(s, p);
|
_tool.RemoveTempObstacle(s, p);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_tool.AddTempObstacle(_hitPos);
|
_tool.AddTempObstacle(p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue