From b1afcc41665ccddf9bf4cd5abaa550686d393d4f Mon Sep 17 00:00:00 2001 From: Atdunbg <979541498@qq.com> Date: Wed, 9 Jul 2025 17:44:50 +0800 Subject: [PATCH] add commandline to load scene file --- Sandbox/src/Editor/EditorLayer.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Sandbox/src/Editor/EditorLayer.cpp b/Sandbox/src/Editor/EditorLayer.cpp index 403db5a..abed044 100644 --- a/Sandbox/src/Editor/EditorLayer.cpp +++ b/Sandbox/src/Editor/EditorLayer.cpp @@ -51,6 +51,14 @@ namespace Hazel m_SceneHierachyPanel.SetContext(m_ActiveScene); m_GizmoType = ImGuizmo::OPERATION::TRANSLATE; + auto commandLineArgs = Application::Get().GetSpecification().commandLineArgs; + if (commandLineArgs.count > 1) + { + auto scenePath = commandLineArgs.args[1]; + SceneSerializer sceneSerializer(m_ActiveScene); + + sceneSerializer.Deserialize(scenePath); + } }