Add LateFixedUpdate event for scripts

This commit is contained in:
2023-03-27 17:43:32 +03:00
parent aa64da9869
commit 558a7d99ff
7 changed files with 53 additions and 3 deletions

View File

@@ -65,6 +65,7 @@ Action Engine::FixedUpdate;
Action Engine::Update;
TaskGraph* Engine::UpdateGraph = nullptr;
Action Engine::LateUpdate;
Action Engine::LateFixedUpdate;
Action Engine::Draw;
Action Engine::Pause;
Action Engine::Unpause;
@@ -198,6 +199,7 @@ int32 Engine::Main(const Char* cmdLine)
if (Time::OnBeginPhysics())
{
OnFixedUpdate();
OnLateFixedUpdate();
Time::OnEndPhysics();
}
@@ -273,6 +275,17 @@ void Engine::OnFixedUpdate()
}
}
void Engine::OnLateFixedUpdate()
{
PROFILE_CPU_NAMED("Late Fixed Update");
// Call event
LateFixedUpdate();
// Update services
EngineService::OnLateFixedUpdate();
}
void Engine::OnUpdate()
{
PROFILE_CPU_NAMED("Update");