Fix scene asset runtime contents when saving scene file in Editor
This commit is contained in:
@@ -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()));
|
||||
|
||||
#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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user