public void ReInitializeDebugItemStates()
        {
            CleanUp();
            // Populate item states
            DebugMenuManager dmm = DebugMenuManager.instance;

            for (int panelIdx = 0; panelIdx < dmm.panelCount; ++panelIdx)
            {
                DebugPanel panel = dmm.GetDebugPanel(panelIdx);
                for (int itemIdx = 0; itemIdx < panel.itemCount; ++itemIdx)
                {
                    DebugItem      item           = panel.GetDebugItem(itemIdx);
                    DebugItemState debugItemState = FindDebugItemState(item);
                    if (debugItemState == null)
                    {
                        debugItemState = item.handler.CreateDebugItemState();
                        if (debugItemState != null)
                        {
                            debugItemState.hideFlags = HideFlags.DontSave;
                            debugItemState.Initialize(item);
                            debugItemState.SetValue(item.GetValue());
                            AddDebugItemState(debugItemState);
                        }
                        else
                        {
                            Debug.LogWarning(String.Format("DebugItemState for item {0} of type {1} is not provided.\nDid you implement CreateDebugItemState in your custom Handler?", item.name, item.type));
                        }
                    }
                }
            }

            UpdateAllDebugItems();
        }
Exemple #2
0
        public void OnEnable()
        {
#if UNITY_EDITOR
            UnityEditor.Undo.undoRedoPerformed += OnUndoRedoPerformed;
#endif
            // Populate item states
            DebugMenuManager dmm = DebugMenuManager.instance;
            for (int panelIdx = 0; panelIdx < dmm.panelCount; ++panelIdx)
            {
                DebugPanel panel = dmm.GetDebugPanel(panelIdx);
                for (int itemIdx = 0; itemIdx < panel.itemCount; ++itemIdx)
                {
                    DebugItem      item           = panel.GetDebugItem(itemIdx);
                    DebugItemState debugItemState = FindDebugItemState(item);
                    if (debugItemState == null)
                    {
                        debugItemState           = item.handler.CreateDebugItemState();
                        debugItemState.hideFlags = HideFlags.DontSave;
                        debugItemState.Initialize(item);
                        debugItemState.SetValue(item.GetValue());
                        AddDebugItemState(debugItemState);
                    }
                }
            }

            DebugMenuManager.instance.SetDebugMenuState(this);
        }
        void OnEnable()
        {
            m_DebugMenu            = DebugMenuManager.instance;
            DebugItem.OnItemDirty += DebugItem_OnDirty;

            if (m_DebugMenuState == null)
            {
                m_DebugMenuState           = ScriptableObject.CreateInstance <DebugMenuState>();
                m_DebugMenuState.hideFlags = HideFlags.DontSave;
            }
        }
Exemple #4
0
 public DebugMenuUI(DebugMenuManager manager)
 {
     m_DebugMenuManager = manager;
 }
Exemple #5
0
 void OnEnable()
 {
     m_DebugMenu = DebugMenuManager.instance;
 }