diff --git a/SHADE_Engine/src/Editor/EditorWindow/MenuBar/SHEditorMenuBar.cpp b/SHADE_Engine/src/Editor/EditorWindow/MenuBar/SHEditorMenuBar.cpp index af2d5517..c18f0c8c 100644 --- a/SHADE_Engine/src/Editor/EditorWindow/MenuBar/SHEditorMenuBar.cpp +++ b/SHADE_Engine/src/Editor/EditorWindow/MenuBar/SHEditorMenuBar.cpp @@ -117,16 +117,22 @@ namespace SHADE auto* scriptEngine = static_cast(SHSystemManager::GetSystem()); scriptEngine->GenerateScriptsCsProjFile(); } + ImGui::BeginDisabled(SHSystemManager::GetSystem()->editorState != SHEditor::State::STOP); 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::EndDisabled(); ImGui::EndMenu(); }