EndOffsetArea() public static méthode

public static EndOffsetArea ( ) : void
Résultat void
        public void OnGUI()
        {
            base.ClearBackground();
            EditorGUIUtility.ResetGUIState();
            Rect rect = new Rect(-2f, 0f, base.position.width + 4f, base.position.height);

            this.background = "dockarea";
            GUIStyle style = "dockareaoverlay";

            rect = this.background.margin.Remove(rect);
            base.DoWindowDecorationStart();
            Rect position = new Rect(rect.x + 1f, rect.y, rect.width - 2f, 17f);

            if (Event.current.type == EventType.Repaint)
            {
                this.background.Draw(rect, GUIContent.none, false, false, false, false);
                GUIStyle gUIStyle = "dragTab";
                gUIStyle.Draw(position, base.actualView.titleContent, false, false, true, base.hasFocus);
            }
            if (Event.current.type == EventType.ContextClick && position.Contains(Event.current.mousePosition))
            {
                base.PopupGenericMenu(base.actualView, new Rect(Event.current.mousePosition.x, Event.current.mousePosition.y, 0f, 0f));
            }
            base.ShowGenericMenu();
            if (base.actualView)
            {
                base.actualView.m_Pos = base.borderSize.Remove(base.screenPosition);
                if (base.actualView is GameView)
                {
                    GUI.Box(rect, GUIContent.none, style);
                }
            }
            DockArea.BeginOffsetArea(new Rect(rect.x + 2f, rect.y + 17f, rect.width - 4f, rect.height - 17f - 2f), GUIContent.none, "TabWindowBackground");
            try
            {
                base.Invoke("OnGUI");
            }
            catch (TargetInvocationException ex)
            {
                throw ex.InnerException;
            }
            EditorGUIUtility.ResetGUIState();
            DockArea.EndOffsetArea();
            base.DoWindowDecorationEnd();
            GUI.Box(rect, GUIContent.none, style);
        }
        public void OnGUI()
        {
            this.ClearBackground();
            EditorGUIUtility.ResetGUIState();
            Rect rect = new Rect(-2f, 0.0f, this.position.width + 4f, this.position.height);

            this.background = (GUIStyle)"dockarea";
            GUIStyle style     = (GUIStyle)"dockareaoverlay";
            Rect     position1 = this.background.margin.Remove(rect);

            this.DoWindowDecorationStart();
            Rect position2 = new Rect(position1.x + 1f, position1.y, position1.width - 2f, 17f);

            if (Event.current.type == EventType.Repaint)
            {
                this.background.Draw(position1, GUIContent.none, false, false, false, false);
                (GUIStyle)"dragTab".Draw(position2, this.actualView.titleContent, false, false, true, this.hasFocus);
            }
            if (Event.current.type == EventType.ContextClick && position2.Contains(Event.current.mousePosition))
            {
                this.PopupGenericMenu(this.actualView, new Rect(Event.current.mousePosition.x, Event.current.mousePosition.y, 0.0f, 0.0f));
            }
            this.ShowGenericMenu();
            if ((bool)((UnityEngine.Object) this.actualView))
            {
                this.actualView.m_Pos = this.borderSize.Remove(this.screenPosition);
                if (this.actualView is GameView)
                {
                    GUI.Box(position1, GUIContent.none, style);
                }
            }
            DockArea.BeginOffsetArea(new Rect(position1.x + 2f, position1.y + 17f, position1.width - 4f, (float)((double)position1.height - 17.0 - 2.0)), GUIContent.none, (GUIStyle)"TabWindowBackground");
            try
            {
                this.Invoke("OnGUI");
            }
            catch (TargetInvocationException ex)
            {
                throw ex.InnerException;
            }
            EditorGUIUtility.ResetGUIState();
            DockArea.EndOffsetArea();
            this.DoWindowDecorationEnd();
            GUI.Box(position1, GUIContent.none, style);
        }
Exemple #3
0
        public void OnGUI()
        {
            base.ClearBackground();
            EditorGUIUtility.ResetGUIState();
            SplitView splitView = base.parent as SplitView;

            if (Event.current.type == EventType.Repaint && splitView)
            {
                View child = this;
                while (splitView)
                {
                    int controlID = splitView.controlID;
                    if (controlID == GUIUtility.hotControl || GUIUtility.hotControl == 0)
                    {
                        int num = splitView.IndexOfChild(child);
                        if (splitView.vertical)
                        {
                            if (num != 0)
                            {
                                EditorGUIUtility.AddCursorRect(new Rect(0f, 0f, base.position.width, 5f), MouseCursor.SplitResizeUpDown, controlID);
                            }
                            if (num != splitView.children.Length - 1)
                            {
                                EditorGUIUtility.AddCursorRect(new Rect(0f, base.position.height - 5f, base.position.width, 5f), MouseCursor.SplitResizeUpDown, controlID);
                            }
                        }
                        else
                        {
                            if (num != 0)
                            {
                                EditorGUIUtility.AddCursorRect(new Rect(0f, 0f, 5f, base.position.height), MouseCursor.SplitResizeLeftRight, controlID);
                            }
                            if (num != splitView.children.Length - 1)
                            {
                                EditorGUIUtility.AddCursorRect(new Rect(base.position.width - 5f, 0f, 5f, base.position.height), MouseCursor.SplitResizeLeftRight, controlID);
                            }
                        }
                    }
                    child     = splitView;
                    splitView = (splitView.parent as SplitView);
                }
                splitView = (base.parent as SplitView);
            }
            bool flag = false;

            if (base.window.mainView.GetType() != typeof(MainWindow))
            {
                flag = true;
                if (base.windowPosition.y == 0f)
                {
                    this.background = "dockareaStandalone";
                }
                else
                {
                    this.background = "dockarea";
                }
            }
            else
            {
                this.background = "dockarea";
            }
            if (splitView)
            {
                Event @event = new Event(Event.current);
                @event.mousePosition += new Vector2(base.position.x, base.position.y);
                splitView.SplitGUI(@event);
                if (@event.type == EventType.Used)
                {
                    Event.current.Use();
                }
            }
            GUIStyle style    = "dockareaoverlay";
            Rect     position = this.background.margin.Remove(new Rect(0f, 0f, base.position.width, base.position.height));

            position.x = (float)this.background.margin.left;
            position.y = (float)this.background.margin.top;
            Rect  windowPosition = base.windowPosition;
            float num2           = 2f;

            if (windowPosition.x == 0f)
            {
                position.x     -= num2;
                position.width += num2;
            }
            if (windowPosition.xMax == base.window.position.width)
            {
                position.width += num2;
            }
            if (windowPosition.yMax == base.window.position.height)
            {
                position.height += ((!flag) ? 2f : 2f);
            }
            GUI.Box(position, GUIContent.none, this.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);
                }
                DockArea.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    pos    = base.borderSize.Remove(base.position);
                pos.x = vector.x;
                pos.y = vector.y;
                this.m_Panes[this.selected].m_Pos = pos;
                EditorGUIUtility.ResetGUIState();
                try
                {
                    base.Invoke("OnGUI");
                }
                catch (TargetInvocationException ex)
                {
                    throw ex.InnerException;
                }
                EditorGUIUtility.ResetGUIState();
                if (base.actualView != null && base.actualView.m_FadeoutTime != 0f && Event.current != null && Event.current.type == EventType.Repaint)
                {
                    base.actualView.DrawNotification();
                }
                DockArea.EndOffsetArea();
            }
            base.DoWindowDecorationEnd();
            GUI.Box(position, GUIContent.none, style);
            EditorGUI.ShowRepaints();
            Highlighter.ControlHighlightGUI(this);
        }
Exemple #4
0
        public void OnGUI()
        {
            this.ClearBackground();
            EditorGUIUtility.ResetGUIState();
            SplitView parent = this.parent as SplitView;

            if (Event.current.type == EventType.Repaint && (bool)((UnityEngine.Object)parent))
            {
                View child = (View)this;
                for (; (bool)((UnityEngine.Object)parent); parent = parent.parent as SplitView)
                {
                    int controlId = parent.controlID;
                    if (controlId == GUIUtility.hotControl || GUIUtility.hotControl == 0)
                    {
                        int num = parent.IndexOfChild(child);
                        if (parent.vertical)
                        {
                            if (num != 0)
                            {
                                EditorGUIUtility.AddCursorRect(new Rect(0.0f, 0.0f, this.position.width, 5f), MouseCursor.SplitResizeUpDown, controlId);
                            }
                            if (num != parent.children.Length - 1)
                            {
                                EditorGUIUtility.AddCursorRect(new Rect(0.0f, this.position.height - 5f, this.position.width, 5f), MouseCursor.SplitResizeUpDown, controlId);
                            }
                        }
                        else
                        {
                            if (num != 0)
                            {
                                EditorGUIUtility.AddCursorRect(new Rect(0.0f, 0.0f, 5f, this.position.height), MouseCursor.SplitResizeLeftRight, controlId);
                            }
                            if (num != parent.children.Length - 1)
                            {
                                EditorGUIUtility.AddCursorRect(new Rect(this.position.width - 5f, 0.0f, 5f, this.position.height), MouseCursor.SplitResizeLeftRight, controlId);
                            }
                        }
                    }
                    child = (View)parent;
                }
                parent = this.parent as SplitView;
            }
            bool flag = false;

            if (this.window.mainView.GetType() != typeof(MainWindow))
            {
                flag = true;
                if ((double)this.windowPosition.y == 0.0)
                {
                    this.background = (GUIStyle)"dockareaStandalone";
                }
                else
                {
                    this.background = (GUIStyle)"dockarea";
                }
            }
            else
            {
                this.background = (GUIStyle)"dockarea";
            }
            if ((bool)((UnityEngine.Object)parent))
            {
                Event evt = new Event(Event.current);
                evt.mousePosition += new Vector2(this.position.x, this.position.y);
                parent.SplitGUI(evt);
                if (evt.type == EventType.Used)
                {
                    Event.current.Use();
                }
            }
            GUIStyle style    = (GUIStyle)"dockareaoverlay";
            Rect     position = this.background.margin.Remove(new Rect(0.0f, 0.0f, this.position.width, this.position.height));

            position.x = (float)this.background.margin.left;
            position.y = (float)this.background.margin.top;
            Rect  windowPosition = this.windowPosition;
            float num1           = 2f;

            if ((double)windowPosition.x == 0.0)
            {
                position.x     -= num1;
                position.width += num1;
            }
            if ((double)windowPosition.xMax == (double)this.window.position.width)
            {
                position.width += num1;
            }
            if ((double)windowPosition.yMax == (double)this.window.position.height)
            {
                position.height += !flag ? 2f : 2f;
            }
            GUI.Box(position, GUIContent.none, this.background);
            if (this.tabStyle == null)
            {
                this.tabStyle = (GUIStyle)"dragtab";
            }
            this.DragTab(new Rect(position.x + 1f, position.y, position.width - 40f, 17f), this.tabStyle);
            this.tabStyle = (GUIStyle)"dragtab";
            this.ShowGenericMenu();
            this.DoWindowDecorationStart();
            if (this.m_Panes.Count > 0)
            {
                if (this.m_Panes[this.selected] is GameView)
                {
                    GUI.Box(position, GUIContent.none, style);
                }
                DockArea.BeginOffsetArea(new Rect(position.x + 2f, position.y + 17f, position.width - 4f, (float)((double)position.height - 17.0 - 2.0)), GUIContent.none, (GUIStyle)"TabWindowBackground");
                Vector2 screenPoint = GUIUtility.GUIToScreenPoint(Vector2.zero);
                Rect    rect        = this.borderSize.Remove(this.position);
                rect.x = screenPoint.x;
                rect.y = screenPoint.y;
                this.m_Panes[this.selected].m_Pos = rect;
                EditorGUIUtility.ResetGUIState();
                try
                {
                    this.Invoke("OnGUI");
                }
                catch (TargetInvocationException ex)
                {
                    throw ex.InnerException;
                }
                EditorGUIUtility.ResetGUIState();
                if ((UnityEngine.Object) this.actualView != (UnityEngine.Object)null && (double)this.actualView.m_FadeoutTime != 0.0 && (Event.current != null && Event.current.type == EventType.Repaint))
                {
                    this.actualView.DrawNotification();
                }
                DockArea.EndOffsetArea();
            }
            this.DoWindowDecorationEnd();
            GUI.Box(position, GUIContent.none, style);
            EditorGUI.ShowRepaints();
            Highlighter.ControlHighlightGUI((GUIView)this);
        }