void OnDisable() { VertexManipulationTool.beforeMeshModification -= BeforeMeshModification; VertexManipulationTool.afterMeshModification -= AfterMeshModification; ClearElementSelection(); UpdateSelection(); if (selectionUpdated != null) { selectionUpdated(null); } SceneView.duringSceneGui -= OnSceneGUI; ProGridsInterface.UnsubscribePushToGridEvent(PushToGrid); ProGridsInterface.UnsubscribeToolbarEvent(ProGridsToolbarOpen); MeshSelection.objectSelectionChanged -= OnObjectSelectionChanged; SetOverrideWireframe(false); m_Toolbar.Dispose(); if (m_ToolManager != null) { m_ToolManager.Dispose(); } OnSelectModeChanged(); ProBuilderToolManager.selectModeChanged -= OnSelectModeChanged; SceneView.RepaintAll(); if (s_Instance == this) { s_Instance = null; } }
void OnDisable() { s_Instance = null; VertexManipulationTool.beforeMeshModification -= BeforeMeshModification; VertexManipulationTool.afterMeshModification -= AfterMeshModification; if (s_EditorToolbar != null) { DestroyImmediate(s_EditorToolbar); } ClearElementSelection(); UpdateSelection(); if (selectionUpdated != null) { selectionUpdated(null); } SceneView.duringSceneGui -= OnSceneGUI; ProGridsInterface.UnsubscribePushToGridEvent(PushToGrid); ProGridsInterface.UnsubscribeToolbarEvent(ProGridsToolbarOpen); MeshSelection.objectSelectionChanged -= OnObjectSelectionChanged; SetOverrideWireframe(false); if (selectModeChanged != null) { selectModeChanged(SelectMode.Object); } SceneView.RepaintAll(); }
void OnDisable() { s_Instance = null; VertexManipulationTool.beforeMeshModification -= BeforeMeshModification; VertexManipulationTool.afterMeshModification -= AfterMeshModification; if (s_EditorToolbar != null) { DestroyImmediate(s_EditorToolbar); } ClearElementSelection(); UpdateSelection(); if (selectionUpdated != null) { selectionUpdated(null); } #if UNITY_2019_1_OR_NEWER SceneView.duringSceneGui -= OnSceneGUI; #else SceneView.onSceneGUIDelegate -= OnSceneGUI; #endif ProGridsInterface.UnsubscribePushToGridEvent(PushToGrid); ProGridsInterface.UnsubscribeToolbarEvent(ProGridsToolbarOpen); MeshSelection.objectSelectionChanged -= OnObjectSelectionChanged; // re-enable unity wireframe // todo set wireframe override in pb_Selection, no pb_Editor foreach (var pb in FindObjectsOfType <ProBuilderMesh>()) { EditorUtility.SetSelectionRenderState(pb.gameObject.GetComponent <Renderer>(), EditorUtility.GetSelectionRenderState()); } if (selectModeChanged != null) { selectModeChanged(SelectMode.Object); } SceneView.RepaintAll(); }