Make Level class to unload scenes in reversed order

This commit is contained in:
Wiktor Kocielski
2023-04-22 20:58:26 +03:00
parent 73ff053470
commit 68151592a4

View File

@@ -903,12 +903,11 @@ bool LevelImpl::unloadScene(Scene* scene)
bool LevelImpl::unloadScenes()
{
auto scenes = Level::Scenes;
for (int32 i = 0; i < scenes.Count(); i++)
for (int32 i = scenes.Count() - 1; i >= 0; i--)
{
if (unloadScene(scenes[i]))
return true;
}
return false;
}