Ejemplo n.º 1
0
        public void OnDisable()
        {
            CallOnToolDeactivated();
            instances.Remove(this);
            if (instances.Count <= 1)
            {
                GridPaintingState.gridBrush = null;
            }
            DestroyPreviewInstance();
            DestroyImmediate(clipboardView);
            DestroyImmediate(m_PaintableSceneViewGrid);

            if (m_PreviewUtility != null)
            {
                m_PreviewUtility.Cleanup();
            }
            m_PreviewUtility = null;

            if (PaintableGrid.InGridEditMode())
            {
                EditMode.QuitEditMode();
            }

            EditMode.editModeStarted                  -= OnEditModeStart;
            EditMode.editModeEnded                    -= OnEditModeEnd;
            Tools.onToolChanged                       -= ToolChanged;
            GridSelection.gridSelectionChanged        -= OnGridSelectionChanged;
            SceneView.onSceneGUIDelegate              -= OnSceneViewGUI;
            GridPaintingState.scenePaintTargetChanged -= OnScenePaintTargetChanged;
            GridPaintingState.brushChanged            -= OnBrushChanged;
            GridPaintingState.UnregisterPainterInterest(this);
            PrefabUtility.prefabInstanceUpdated -= PrefabInstanceUpdated;

            ShortcutIntegration.instance.contextManager.DeregisterToolContext(m_ShortcutContext);
        }
 public void OnDisable()
 {
     CallOnToolDeactivated();
     instances.Remove(this);
     DestroyPreviewInstance();
     EditorApplication.globalEventHandler -= HotkeyHandler;
     EditMode.editModeStarted             -= OnEditModeStart;
     EditMode.editModeEnded                    -= OnEditModeEnd;
     Tools.onToolChanged                       -= ToolChanged;
     GridSelection.gridSelectionChanged        -= OnGridSelectionChanged;
     SceneView.onSceneGUIDelegate              -= OnSceneViewGUI;
     GridPaintingState.scenePaintTargetChanged -= OnScenePaintTargetChanged;
     GridPaintingState.brushChanged            -= OnBrushChanged;
     GridPaintingState.UnregisterPainterInterest(this);
     PrefabUtility.prefabInstanceUpdated -= PrefabInstanceUpdated;
 }
Ejemplo n.º 3
0
 public void OnDisable()
 {
     this.CallOnToolDeactivated();
     GridPaintPaletteWindow.instances.Remove(this);
     this.DestroyPreviewInstance();
     EditorApplication.globalEventHandler = (EditorApplication.CallbackFunction)Delegate.Remove(EditorApplication.globalEventHandler, new EditorApplication.CallbackFunction(this.HotkeyHandler));
     EditMode.editModeStarted            -= new Action <IToolModeOwner, EditMode.SceneViewEditMode>(this.OnEditModeStart);
     EditMode.editModeEnded                    -= new Action <IToolModeOwner>(this.OnEditModeEnd);
     Tools.onToolChanged                        = (Tools.OnToolChangedFunc)Delegate.Remove(Tools.onToolChanged, new Tools.OnToolChangedFunc(this.ToolChanged));
     GridSelection.gridSelectionChanged        -= new Action(this.OnGridSelectionChanged);
     SceneView.onSceneGUIDelegate               = (SceneView.OnSceneFunc)Delegate.Remove(SceneView.onSceneGUIDelegate, new SceneView.OnSceneFunc(this.OnSceneViewGUI));
     GridPaintingState.scenePaintTargetChanged -= new Action <GameObject>(this.OnScenePaintTargetChanged);
     GridPaintingState.brushChanged            -= new Action <GridBrushBase>(this.OnBrushChanged);
     GridPaintingState.UnregisterPainterInterest(this);
     PrefabUtility.prefabInstanceUpdated = (PrefabUtility.PrefabInstanceUpdated)Delegate.Remove(PrefabUtility.prefabInstanceUpdated, new PrefabUtility.PrefabInstanceUpdated(this.PrefabInstanceUpdated));
 }