Merge remote-tracking branch 'origin/master' into 1.6

# Conflicts:
#	.github/workflows/tests.yml
#	Source/Engine/Content/JsonAsset.cs
This commit is contained in:
Wojtek Figat
2023-05-07 19:46:29 +02:00
31 changed files with 603 additions and 311 deletions

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;
}
@@ -1210,6 +1209,15 @@ bool LevelImpl::saveScene(Scene* scene, const String& path)
LOG(Info, "Scene saved! Time {0} ms", Math::CeilToInt((float)(DateTime::NowUTC() - startTime).GetTotalMilliseconds()));
#if USE_EDITOR
// Reload asset at the target location if is loaded
Asset* asset = Content::GetAsset(sceneId);
if (!asset)
asset = Content::GetAsset(path);
if (asset)
asset->Reload();
#endif
// Fire event
CallSceneEvent(SceneEventType::OnSceneSaved, scene, sceneId);