Example #1
0
        void OnEnable()
        {
            hideFlags = HideFlags.HideAndDontSave;
            autoRepaintOnSceneChange = true;

            if (m_Settings == null)
            {
                m_Settings = CreateInstance <DebugWindowSettings>();
            }

            // States are ScriptableObjects (necessary for Undo/Redo) but are not saved on disk so when the editor is closed then reopened, any existing debug window will have its states set to null
            // Since we don't care about persistance in this case, we just re-init everything.
            if (m_WidgetStates == null || !AreWidgetStatesValid())
            {
                m_WidgetStates = new WidgetStateDictionary();
            }

            if (s_WidgetStateMap == null || s_WidgetDrawerMap == null || s_TypeMapDirty)
            {
                RebuildTypeMaps();
            }

            Undo.undoRedoPerformed           += OnUndoRedoPerformed;
            DebugManager.instance.onSetDirty += MarkDirty;

            // First init
            m_DebugTreeState = DebugManager.instance.GetState();
            UpdateWidgetStates();
        }
        void OnEnable()
        {
            hideFlags = HideFlags.HideAndDontSave;
            autoRepaintOnSceneChange = true;

            if (m_Settings == null)
            {
                m_Settings = CreateInstance <DebugWindowSettings>();
            }

            if (m_WidgetStates == null)
            {
                m_WidgetStates = new WidgetStateDictionary();
            }

            if (s_WidgetStateMap == null || s_WidgetDrawerMap == null || s_TypeMapDirty)
            {
                RebuildTypeMaps();
            }

            Undo.undoRedoPerformed           += OnUndoRedoPerformed;
            DebugManager.instance.onSetDirty += MarkDirty;

            // First init
            m_DebugTreeState = DebugManager.instance.GetState();
            UpdateWidgetStates();
        }
Example #3
0
        void OnEnable()
        {
            DebugManager.instance.refreshEditorRequested = false;

            hideFlags = HideFlags.HideAndDontSave;
            autoRepaintOnSceneChange = true;

            if (m_Settings == null)
            {
                m_Settings = CreateInstance <DebugWindowSettings>();
            }

            // States are ScriptableObjects (necessary for Undo/Redo) but are not saved on disk so when the editor is closed then reopened, any existing debug window will have its states set to null
            // Since we don't care about persistance in this case, we just re-init everything.
            if (m_WidgetStates == null || !AreWidgetStatesValid())
            {
                m_WidgetStates = new WidgetStateDictionary();
            }

            if (s_WidgetStateMap == null || s_WidgetDrawerMap == null || s_TypeMapDirty)
            {
                RebuildTypeMaps();
            }

            Undo.undoRedoPerformed           += OnUndoRedoPerformed;
            DebugManager.instance.onSetDirty += MarkDirty;

            // First init
            m_DebugTreeState = DebugManager.instance.GetState();
            UpdateWidgetStates();

            EditorApplication.update -= Repaint;
            var panels             = DebugManager.instance.panels;
            var selectedPanelIndex = m_Settings.selectedPanel;

            if (selectedPanelIndex >= 0 &&
                selectedPanelIndex < panels.Count &&
                panels[selectedPanelIndex].editorForceUpdate)
            {
                EditorApplication.update += Repaint;
            }
        }