Ejemplo n.º 1
0
        internal void Exit()
        {
            Log("Editor exit");

            // Start exit
            StateMachine.GoToState <ClosingState>();

            Scene.ClearRefsToSceneObjects();

            // Release modules (from back to front)
            for (int i = _modules.Count - 1; i >= 0; i--)
            {
                _modules[i].OnExit();
            }

            // Cleanup
            Undo.Dispose();
            Instance = null;

            ScriptsBuilder.ScriptsReloadBegin -= ScriptsBuilder_ScriptsReloadBegin;
            ScriptsBuilder.ScriptsReloadEnd   -= ScriptsBuilder_ScriptsReloadEnd;

            // Invoke new instance if need to open a project
            if (!string.IsNullOrEmpty(_projectToOpen))
            {
                string editorExePath = Globals.StartupPath + "/Win64/FlaxEditor.exe";
                string args          = string.Format("-project \"{0}\"", _projectToOpen);
                _projectToOpen = null;
                Application.StartProcess(editorExePath, args);
            }
        }
Ejemplo n.º 2
0
        internal void Exit()
        {
            Log("Editor exit");

            // Start exit
            StateMachine.GoToState <ClosingState>();

            // Cache last opened scene
            {
                var lastSceneId    = SceneManager.ScenesCount > 0 ? SceneManager.Scenes[0].ID : Guid.Empty;
                var lastSceneSpawn = Windows.EditWin.Viewport.ViewRay;
                ProjectCache.SetCustomData(ProjectDataLastScene, lastSceneId.ToString());
                ProjectCache.SetCustomData(ProjectDataLastSceneSpawn, JsonSerializer.Serialize(lastSceneSpawn));
            }

            // Cleanup
            Scene.ClearRefsToSceneObjects(true);

            // Release modules (from back to front)
            for (int i = _modules.Count - 1; i >= 0; i--)
            {
                _modules[i].OnExit();
            }

            // Cleanup
            Undo.Dispose();
            Instance = null;

            ScriptsBuilder.ScriptsReloadBegin -= ScriptsBuilder_ScriptsReloadBegin;
            ScriptsBuilder.ScriptsReloadEnd   -= ScriptsBuilder_ScriptsReloadEnd;

            // Invoke new instance if need to open a project
            if (!string.IsNullOrEmpty(_projectToOpen))
            {
                string editorExePath = Globals.StartupPath + "/Win64/FlaxEditor.exe";
                string args          = string.Format("-project \"{0}\"", _projectToOpen);
                _projectToOpen = null;
                Platform.StartProcess(editorExePath, args);
            }
        }
Ejemplo n.º 3
0
        internal void Exit()
        {
            Log("Editor exit");

            // Start exit
            StateMachine.GoToState <ClosingState>();

            Scene.ClearRefsToSceneObjects();

            // Release modules (from back to front)
            for (int i = _modules.Count - 1; i >= 0; i--)
            {
                _modules[i].OnExit();
            }

            // Cleanup
            Undo.Dispose();
            Instance = null;

            ScriptsBuilder.ScriptsReloadBegin -= ScriptsBuilder_ScriptsReloadBegin;
            ScriptsBuilder.ScriptsReloadEnd   -= ScriptsBuilder_ScriptsReloadEnd;
        }