From 8d6c693e05bebcc321fb3c4c32191f20a60a2bb4 Mon Sep 17 00:00:00 2001 From: ikpil Date: Sun, 10 Sep 2023 11:56:14 +0900 Subject: [PATCH] refactor: ObstacleSampleTool --- src/DotRecast.Recast.Demo/Tools/ObstacleSampleTool.cs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/DotRecast.Recast.Demo/Tools/ObstacleSampleTool.cs b/src/DotRecast.Recast.Demo/Tools/ObstacleSampleTool.cs index b4f0b90..34b0ef2 100644 --- a/src/DotRecast.Recast.Demo/Tools/ObstacleSampleTool.cs +++ b/src/DotRecast.Recast.Demo/Tools/ObstacleSampleTool.cs @@ -14,10 +14,7 @@ public class ObstacleSampleTool : ISampleTool private static readonly ILogger Logger = Log.ForContext(); private DemoSample _sample; - private readonly RcObstacleTool _tool; - private bool _hitPosSet; - private RcVec3f _hitPos; public ObstacleSampleTool() { @@ -103,16 +100,13 @@ public class ObstacleSampleTool : ISampleTool public void HandleClick(RcVec3f s, RcVec3f p, bool shift) { - _hitPosSet = true; - _hitPos = p; - if (shift) { _tool.RemoveTempObstacle(s, p); } else { - _tool.AddTempObstacle(_hitPos); + _tool.AddTempObstacle(p); } }