From 06afd384af2cb63da4373947971ee84d8dffac31 Mon Sep 17 00:00:00 2001 From: Kah Wei Date: Sat, 5 Nov 2022 14:56:52 +0800 Subject: [PATCH] Scenes are now reloaded and scripts are no longer lost when building scripts --- .../src/Editor/EditorWindow/MenuBar/SHEditorMenuBar.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/SHADE_Engine/src/Editor/EditorWindow/MenuBar/SHEditorMenuBar.cpp b/SHADE_Engine/src/Editor/EditorWindow/MenuBar/SHEditorMenuBar.cpp index af2d5517..d1e359b6 100644 --- a/SHADE_Engine/src/Editor/EditorWindow/MenuBar/SHEditorMenuBar.cpp +++ b/SHADE_Engine/src/Editor/EditorWindow/MenuBar/SHEditorMenuBar.cpp @@ -120,12 +120,16 @@ namespace SHADE if (ImGui::Selectable("Build Scripts - Debug")) { auto* scriptEngine = static_cast(SHSystemManager::GetSystem()); + SHSerialization::SerializeSceneToFile(SHSceneManager::GetCurrentSceneAssetID()); scriptEngine->BuildScriptAssembly(true, true); + SHSceneManager::RestartScene(SHSceneManager::GetCurrentSceneAssetID()); } if (ImGui::Selectable("Build Scripts - Release")) { auto* scriptEngine = static_cast(SHSystemManager::GetSystem()); - scriptEngine->BuildScriptAssembly(false, true); + SHSerialization::SerializeSceneToFile(SHSceneManager::GetCurrentSceneAssetID()); + scriptEngine->BuildScriptAssembly(false, true); + SHSceneManager::RestartScene(SHSceneManager::GetCurrentSceneAssetID()); } ImGui::EndMenu(); }