refactor: ObstacleSampleTool

This commit is contained in:
ikpil 2023-09-10 11:56:14 +09:00
parent 122239030a
commit 8d6c693e05
1 changed files with 1 additions and 7 deletions

View File

@ -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);
} }
} }