UnityEditor.DockArea.OnGUI C# (CSharp) Method

OnGUI() public method

public OnGUI ( ) : void
return void
        public void OnGUI()
        {
            base.ClearBackground();
            EditorGUIUtility.ResetGUIState();
            SplitView parent = base.parent as SplitView;
            if ((Event.current.type == EventType.Repaint) && (parent != null))
            {
                View child = this;
                while (parent != null)
                {
                    int controlID = parent.controlID;
                    if ((controlID == GUIUtility.hotControl) || (GUIUtility.hotControl == 0))
                    {
                        int num2 = parent.IndexOfChild(child);
                        if (parent.vertical)
                        {
                            if (num2 != 0)
                            {
                                EditorGUIUtility.AddCursorRect(new Rect(0f, 0f, base.position.width, 5f), MouseCursor.SplitResizeUpDown, controlID);
                            }
                            if (num2 != (parent.children.Length - 1))
                            {
                                EditorGUIUtility.AddCursorRect(new Rect(0f, base.position.height - 5f, base.position.width, 5f), MouseCursor.SplitResizeUpDown, controlID);
                            }
                        }
                        else
                        {
                            if (num2 != 0)
                            {
                                EditorGUIUtility.AddCursorRect(new Rect(0f, 0f, 5f, base.position.height), MouseCursor.SplitResizeLeftRight, controlID);
                            }
                            if (num2 != (parent.children.Length - 1))
                            {
                                EditorGUIUtility.AddCursorRect(new Rect(base.position.width - 5f, 0f, 5f, base.position.height), MouseCursor.SplitResizeLeftRight, controlID);
                            }
                        }
                    }
                    child = parent;
                    parent = parent.parent as SplitView;
                }
                parent = base.parent as SplitView;
            }
            bool flag = false;
            if (base.window.mainView.GetType() != typeof(MainWindow))
            {
                flag = true;
                if (base.windowPosition.y == 0f)
                {
                    base.background = "dockareaStandalone";
                }
                else
                {
                    base.background = "dockarea";
                }
            }
            else
            {
                base.background = "dockarea";
            }
            if (parent != null)
            {
                Event event2;
                event2 = new Event(Event.current) {
                    mousePosition = event2.mousePosition + new Vector2(base.position.x, base.position.y)
                };
                parent.SplitGUI(event2);
                if (event2.type == EventType.Used)
                {
                    Event.current.Use();
                }
            }
            GUIStyle style = "dockareaoverlay";
            Rect position = base.background.margin.Remove(new Rect(0f, 0f, base.position.width, base.position.height));
            position.x = base.background.margin.left;
            position.y = base.background.margin.top;
            Rect windowPosition = base.windowPosition;
            float num3 = 2f;
            if (windowPosition.x == 0f)
            {
                position.x -= num3;
                position.width += num3;
            }
            if (windowPosition.xMax == base.window.position.width)
            {
                position.width += num3;
            }
            if (windowPosition.yMax == base.window.position.height)
            {
                position.height += !flag ? 2f : 2f;
            }
            GUI.Box(position, GUIContent.none, base.background);
            if (this.tabStyle == null)
            {
                this.tabStyle = "dragtab";
            }
            this.DragTab(new Rect(position.x + 1f, position.y, position.width - 40f, 17f), this.tabStyle);
            this.tabStyle = "dragtab";
            base.ShowGenericMenu();
            base.DoWindowDecorationStart();
            if (this.m_Panes.Count > 0)
            {
                if (this.m_Panes[this.selected] is GameView)
                {
                    GUI.Box(position, GUIContent.none, style);
                }
                BeginOffsetArea(new Rect(position.x + 2f, position.y + 17f, position.width - 4f, (position.height - 17f) - 2f), GUIContent.none, "TabWindowBackground");
                Vector2 vector = GUIUtility.GUIToScreenPoint(Vector2.zero);
                Rect rect3 = base.borderSize.Remove(base.position);
                rect3.x = vector.x;
                rect3.y = vector.y;
                this.m_Panes[this.selected].m_Pos = rect3;
                EditorGUIUtility.ResetGUIState();
                try
                {
                    base.Invoke("OnGUI");
                }
                catch (TargetInvocationException exception)
                {
                    throw exception.InnerException;
                }
                EditorGUIUtility.ResetGUIState();
                if (((base.actualView != null) && (base.actualView.m_FadeoutTime != 0f)) && ((Event.current != null) && (Event.current.type == EventType.Repaint)))
                {
                    base.actualView.DrawNotification();
                }
                EndOffsetArea();
            }
            base.DoWindowDecorationEnd();
            GUI.Box(position, GUIContent.none, style);
            EditorGUI.ShowRepaints();
            Highlighter.ControlHighlightGUI(this);
        }