Merge branch 'sceneunloading' of https://github.com/Withaust/FlaxEngine into Withaust-sceneunloading

This commit is contained in:
Wojtek Figat
2023-05-05 16:19:16 +02:00

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;
}