Add Engine::UpdateCount to sync gameplay logic updates with game loop rather than draw frames

This commit is contained in:
Wojtek Figat
2024-04-17 13:31:12 +02:00
parent 692a61c948
commit e53ab10145
4 changed files with 14 additions and 6 deletions

View File

@@ -55,10 +55,10 @@ void AnimatedModel::UpdateAnimation()
|| !IsActiveInHierarchy()
|| SkinnedModel == nullptr
|| !SkinnedModel->IsLoaded()
|| _lastUpdateFrame == Engine::FrameCount
|| _lastUpdateFrame == Engine::UpdateCount
|| _masterPose)
return;
_lastUpdateFrame = Engine::FrameCount;
_lastUpdateFrame = Engine::UpdateCount;
if (AnimationGraph && AnimationGraph->IsLoaded() && AnimationGraph->Graph.IsReady())
{