// Close the editor window.
        public void Close()
        {
            // Guard against multiple call to Close in the same stack
            // (since we call DestroyImmediate at the end of Close()).
            if (!this)
            {
                return;
            }

            // Ensure to restore normal workspace before destroying. Fix case 406657.
            if (WindowLayout.IsMaximized(this))
            {
                WindowLayout.Unmaximize(this);
            }

            DockArea da = m_Parent as DockArea;

            if (da)
            {
                da.RemoveTab(this, true);
            }
            else
            {
                m_Parent.window.Close();
            }
            UnityEngine.Object.DestroyImmediate(this, true);
            EditorWindow.UpdateWindowMenuListing();
        }
示例#2
0
 internal static void MaximizeKeyHandler()
 {
     if ((WindowLayout.s_MaximizeKey.activated || Event.current.type == EditorGUIUtility.magnifyGestureEventType) && GUIUtility.hotControl == 0)
     {
         EventType type = Event.current.type;
         Event.current.Use();
         EditorWindow mouseOverWindow = EditorWindow.mouseOverWindow;
         if (mouseOverWindow && !(mouseOverWindow is PreviewWindow))
         {
             if (type == EditorGUIUtility.magnifyGestureEventType)
             {
                 if ((double)Event.current.delta.x < -0.05)
                 {
                     if (WindowLayout.IsMaximized(mouseOverWindow))
                     {
                         WindowLayout.Unmaximize(mouseOverWindow);
                     }
                 }
                 else if ((double)Event.current.delta.x > 0.05 && !WindowLayout.IsMaximized(mouseOverWindow))
                 {
                     WindowLayout.Maximize(mouseOverWindow);
                 }
             }
             else if (WindowLayout.IsMaximized(mouseOverWindow))
             {
                 WindowLayout.Unmaximize(mouseOverWindow);
             }
             else
             {
                 WindowLayout.Maximize(mouseOverWindow);
             }
         }
     }
 }
示例#3
0
        public void Close()
        {
            if (WindowLayout.IsMaximized(this))
            {
                WindowLayout.Unmaximize(this);
            }
            DockArea dockArea = this.m_Parent as DockArea;

            if (dockArea)
            {
                dockArea.RemoveTab(this, true);
            }
            else
            {
                this.m_Parent.window.Close();
            }
            UnityEngine.Object.DestroyImmediate(this, true);
        }
示例#4
0
        /// <summary>
        ///   <para>Close the editor window.</para>
        /// </summary>
        public void Close()
        {
            if (WindowLayout.IsMaximized(this))
            {
                WindowLayout.Unmaximize(this);
            }
            DockArea parent = this.m_Parent as DockArea;

            if ((bool)((UnityEngine.Object)parent))
            {
                parent.RemoveTab(this, true);
            }
            else
            {
                this.m_Parent.window.Close();
            }
            UnityEngine.Object.DestroyImmediate((UnityEngine.Object) this, true);
        }
示例#5
0
        public void Close()
        {
            if (WindowLayout.IsMaximized(this))
            {
                WindowLayout.Unmaximize(this);
            }
            DockArea parent = this.m_Parent as DockArea;

            if (parent != null)
            {
                parent.RemoveTab(this, true);
            }
            else
            {
                this.m_Parent.window.Close();
            }
            Object.DestroyImmediate(this, true);
        }
示例#6
0
        internal static void MaximizeKeyHandler()
        {
            if (!WindowLayout.s_MaximizeKey.activated && Event.current.type != EditorGUIUtility.magnifyGestureEventType || GUIUtility.hotControl != 0)
            {
                return;
            }
            EventType type = Event.current.type;

            Event.current.Use();
            EditorWindow mouseOverWindow = EditorWindow.mouseOverWindow;

            if (!(bool)((UnityEngine.Object)mouseOverWindow) || mouseOverWindow is PreviewWindow)
            {
                return;
            }
            if (type == EditorGUIUtility.magnifyGestureEventType)
            {
                if ((double)Event.current.delta.x < -0.05)
                {
                    if (!WindowLayout.IsMaximized(mouseOverWindow))
                    {
                        return;
                    }
                    WindowLayout.Unmaximize(mouseOverWindow);
                }
                else
                {
                    if ((double)Event.current.delta.x <= 0.05 || WindowLayout.IsMaximized(mouseOverWindow))
                    {
                        return;
                    }
                    WindowLayout.Maximize(mouseOverWindow);
                }
            }
            else if (WindowLayout.IsMaximized(mouseOverWindow))
            {
                WindowLayout.Unmaximize(mouseOverWindow);
            }
            else
            {
                WindowLayout.Maximize(mouseOverWindow);
            }
        }
        // Close the editor window.
        public void Close()
        {
            // Ensure to restore normal workspace before destroying. Fix case 406657.
            if (WindowLayout.IsMaximized(this))
            {
                WindowLayout.Unmaximize(this);
            }

            DockArea da = m_Parent as DockArea;

            if (da)
            {
                da.RemoveTab(this, true);
            }
            else
            {
                m_Parent.window.Close();
            }
            UnityEngine.Object.DestroyImmediate(this, true);
        }