UnsubscribeToolbarEvent() public static method

Remove subscription from extendo/retracto tooblar events.
public static UnsubscribeToolbarEvent ( Action listener ) : void
listener Action
return void
        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;
            }
        }
示例#2
0
        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();
        }
示例#3
0
        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();
        }