| 118 | } |
| 119 | |
| 120 | void AnimationsSystem::Execute(TaskGraph* graph) |
| 121 | { |
| 122 | if (AnimationManagerInstance.UpdateList.Count() == 0) |
| 123 | return; |
| 124 | Active = true; |
| 125 | |
| 126 | // Ensure no animation assets can be reloaded/modified during async update |
| 127 | Animations::SystemLocker.ReadLock(); |
| 128 | |
| 129 | // Setup data for async update |
| 130 | const auto& tickData = Time::Update; |
| 131 | DeltaTime = tickData.DeltaTime.GetTotalSeconds(); |
| 132 | UnscaledDeltaTime = tickData.UnscaledDeltaTime.GetTotalSeconds(); |
| 133 | Time = tickData.Time.GetTotalSeconds(); |
| 134 | UnscaledTime = tickData.UnscaledTime.GetTotalSeconds(); |
| 135 | |
| 136 | #if USE_EDITOR |
| 137 | // If debug flow is registered, then warm it up (eg. static cached method inside DebugFlow_ManagedWrapper) so it doesn't crash on highly multi-threaded code |
| 138 | if (Animations::DebugFlow.IsBinded()) |
| 139 | Animations::DebugFlow(Animations::DebugFlowInfo()); |
| 140 | #endif |
| 141 | |
| 142 | // Schedule work to update all animated models in async |
| 143 | Function<void(int32)> job; |
| 144 | job.Bind<AnimationsSystem, &AnimationsSystem::Job>(this); |
| 145 | graph->DispatchJob(job, AnimationManagerInstance.UpdateList.Count()); |
| 146 | } |
| 147 | |
| 148 | void AnimationsSystem::PostExecute(TaskGraph* graph) |
| 149 | { |
nothing calls this directly
no test coverage detected