feat skip updates for unselected tools

This commit is contained in:
ikpil 2023-09-09 14:04:25 +09:00
parent 9744987da7
commit db13598295
2 changed files with 5 additions and 6 deletions

View File

@ -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++;

View File

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