diff --git a/src/DotRecast.Recast.Demo/RecastDemo.cs b/src/DotRecast.Recast.Demo/RecastDemo.cs index ff97355..828ae5a 100644 --- a/src/DotRecast.Recast.Demo/RecastDemo.cs +++ b/src/DotRecast.Recast.Demo/RecastDemo.cs @@ -497,7 +497,11 @@ public class RecastDemo : IRecastDemoChannel timeAcc -= DELTA_TIME; if (simIter < 5 && _sample != null) { - toolset.HandleUpdate(DELTA_TIME); + var tool = toolset.GetTool(); + if (null != tool) + { + tool.HandleUpdate(DELTA_TIME); + } } simIter++; diff --git a/src/DotRecast.Recast.Demo/UI/RcToolsetView.cs b/src/DotRecast.Recast.Demo/UI/RcToolsetView.cs index 367fc6b..55fe982 100644 --- a/src/DotRecast.Recast.Demo/UI/RcToolsetView.cs +++ b/src/DotRecast.Recast.Demo/UI/RcToolsetView.cs @@ -105,9 +105,4 @@ public class RcToolsetView : IRcView tools.ForEach(t => t.SetSample(sample)); tools.ForEach(t => t.OnSampleChanged()); } - - public void HandleUpdate(float dt) - { - tools.ForEach(t => t.HandleUpdate(dt)); - } } \ No newline at end of file