feat: add play / editor mode
This commit is contained in:
@@ -16,17 +16,27 @@ Scene& SceneManager::GetCurrentScene() const {
|
||||
|
||||
void SceneManager::Update(float dt) {
|
||||
for (const auto& scene : m_activeScenes) {
|
||||
scene->Update(dt);
|
||||
if (m_playing) {
|
||||
scene->Update(dt);
|
||||
} else {
|
||||
scene->CommitPendingAdditions();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SceneManager::FixedUpdate(float dt) {
|
||||
if (!m_playing) {
|
||||
return;
|
||||
}
|
||||
for (const auto& scene : m_activeScenes) {
|
||||
scene->FixedUpdate(dt);
|
||||
}
|
||||
}
|
||||
|
||||
void SceneManager::LateUpdate(float dt) {
|
||||
if (!m_playing) {
|
||||
return;
|
||||
}
|
||||
for (const auto& scene : m_activeScenes) {
|
||||
scene->LateUpdate(dt);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user