void OnDestroy() { Inst = null; // 场景主界面 if (m_sceneWindow != null) { m_sceneWindow.CloseWindow(); } m_sceneWindow = null; // 事件关闭 SceneView.onSceneGUIDelegate -= OnSceneGUI; EditorSceneManager.sceneOpened -= OnSceneOpened; }
private void Initialize() { if (Inst == null) { OpenCubeWorldEditorWindow(); } // 层初始化 var layer = typeof(TemplateGrid).Name; if (!TagOperation.IsHasLayer(layer)) { TagOperation.AddLayer(layer); } // 关卡 Environment.Inst.Initialize(); // 资源 ResManager.Inst.Initialize(); // 场景界面 m_sceneWindow = new SceneWindow(); m_sceneWindow.Initialize(); // 切换工具事件 m_sceneWindow.switchToolsEventHandler += OnSwitchToolsEventHandler; // TODO m_templateGridSize = new Vector2Int(40, 40); // 资源预览 classRecords = new Dictionary <string, bool>(); m_secondaryGroupId = ""; m_resGroup = null; m_resObject = null; }