diff --git a/Editor/Source/Editor/Windows/EditorInterface.cpp b/Editor/Source/Editor/Windows/EditorInterface.cpp index 24619a14..4fa41403 100644 --- a/Editor/Source/Editor/Windows/EditorInterface.cpp +++ b/Editor/Source/Editor/Windows/EditorInterface.cpp @@ -2166,6 +2166,13 @@ namespace Nuake { prefabEditors.push_back(CreateRef(newPrefab)); } + void EditorInterface::OpenSceneWindow(Ref scene) + { + Ref sceneEditor = CreateRef(scene); + sceneEditor->DockTo(SceneEditorDockspaceNodeID); + sceneEditors.push_back(sceneEditor); + } + void EditorInterface::OpenSceneWindow(const std::string& scenePath) { if (!FileSystem::FileExists(scenePath)) @@ -2548,7 +2555,14 @@ namespace Nuake { _WelcomeWindow->LoadQueuedProject(); auto project = Engine::GetProject(); - OpenSceneWindow(project->DefaultScene->Path); + + auto sceneToLoad = project->DefaultScene; + if (!sceneToLoad) + { + sceneToLoad = CreateRef(); + } + + OpenSceneWindow(sceneToLoad); isLoadingProjectQueue = false; diff --git a/Editor/Source/Editor/Windows/EditorInterface.h b/Editor/Source/Editor/Windows/EditorInterface.h index 35227184..bcdc6fcd 100644 --- a/Editor/Source/Editor/Windows/EditorInterface.h +++ b/Editor/Source/Editor/Windows/EditorInterface.h @@ -131,6 +131,7 @@ namespace Nuake void OnRequestCloseEditorWindow(std::string windowName); void OpenPrefabWindow(const std::string& prefabPath); + void OpenSceneWindow(Ref scene); void OpenSceneWindow(const std::string& scenePath); bool ShouldDrawAxis() const { return m_DrawAxis; }