Ejemplo n.º 1
0
        private void End()
        {
            _allocatedMemory = true;
            var main = _blocks[0];

            main.Dispose();

            if (_currentPhase == GUIPhase.Layout)
            {
                main.ResetDimensions();
                main.Layout(_startRect);
                Height        = main.height.Value;
                _currentPhase = GUIPhase.Draw;

                #if dbg_level_1
                Debug.Log("Done layout. Deepest Block depth: {0}. Total number of blocks created: {1}. Total number of controls {2}"
                          .FormatWith(dbgMaxDepth, _blocks.Count, _controls.Count));
                #endif
            }
            else
            {
                if (_pendingResetRequest || _nextControlIdx != _controls.Count || _nextBlockIdx != _blocks.Count)
                {
                    #if dbg_level_1
                    if (pendingResetRequest)
                    {
                        Debug.Log("Resetting - Theres a reset request pending");
                    }
                    else
                    {
                        Debug.Log("Resetting -  The number of controls/blocks drawn doesn't match the total number of controls/blocks");
                    }
                    #endif
                    _controls.Clear();
                    _blocks.Clear();
                    _allocatedMemory = false;
                    _currentPhase    = GUIPhase.Layout;
                }
                else if (_pendingLayoutRequest)
                {
                    #if dbg_level_1
                    Debug.Log("Pending layout request. Doing layout in next phase");
                    #endif
                    _currentPhase = GUIPhase.Layout;
                    EditorHelper.RepaintAllInspectors();
                }
                else
                {
                    bool resized = _prevInspectorWidth != EditorGUIUtility.currentViewWidth;
                    if (resized)
                    {
                        #if dbg_level_1
                        Debug.Log("Resized inspector. Doing layout in next phase");
                        #endif
                        _prevInspectorWidth = EditorGUIUtility.currentViewWidth;
                        _currentPhase       = GUIPhase.Layout;
                    }
                }
            }
        }
Ejemplo n.º 2
0
        public RabbitGUI()
        {
            _currentPhase = GUIPhase.Layout;
            _controls     = new List <GUIControl>();
            _blocks       = new List <GUIBlock>();
            _blockStack   = new Stack <GUIBlock>();

#if dbg_level_1
            Debug.Log("Instantiated Rabbit");
#endif
        }
Ejemplo n.º 3
0
        public RabbitGUI()
        {
            EditorApplication.playmodeStateChanged += HandlePlaymodeTransition;

            currentPhase = GUIPhase.Layout;
            controls     = new List <GUIControl>();
            blocks       = new List <GUIBlock>();
            blockStack   = new Stack <GUIBlock>();

                        #if dbg_level_1
            Debug.Log("Instantiated Rabbit");
                        #endif
        }