Fix scene asset runtime contents when saving scene file in Editor

This commit is contained in:
Wojtek Figat
2023-05-06 14:58:10 +02:00
parent 2affebd375
commit 10bab59acc

View File

@@ -1209,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())); 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 // Fire event
CallSceneEvent(SceneEventType::OnSceneSaved, scene, sceneId); CallSceneEvent(SceneEventType::OnSceneSaved, scene, sceneId);