UnityEditor.View.RemoveChild C# (CSharp) Method

RemoveChild() public method

public RemoveChild ( View child ) : void
child View
return void
        public virtual void RemoveChild(View child)
        {
            int index = Array.IndexOf<View>(this.m_Children, child);
            if (index == -1)
            {
                Debug.LogError("Unable to remove child - it's not IN the view");
            }
            else
            {
                this.RemoveChild(index);
            }
        }

Same methods

View::RemoveChild ( int idx ) : void

Usage Example

示例#1
0
        public static View MaximizePrepare(EditorWindow win)
        {
            View parent = win.m_Parent.parent;
            View view   = parent;

            while (parent != null && parent is SplitView)
            {
                view   = parent;
                parent = parent.parent;
            }
            DockArea dockArea = win.m_Parent as DockArea;

            if (dockArea == null)
            {
                return(null);
            }
            if (parent == null)
            {
                return(null);
            }
            MainWindow x = view.parent as MainWindow;

            if (x == null)
            {
                return(null);
            }
            ContainerWindow window = win.m_Parent.window;

            if (window == null)
            {
                return(null);
            }
            int num = dockArea.m_Panes.IndexOf(win);

            if (num == -1)
            {
                return(null);
            }
            dockArea.selected = num;
            WindowLayout.SaveSplitViewAndChildren(view, win, Path.Combine(WindowLayout.layoutsProjectPath, "CurrentMaximizeLayout.dwlt"));
            dockArea.actualView   = null;
            dockArea.m_Panes[num] = null;
            MaximizedHostView maximizedHostView = ScriptableObject.CreateInstance <MaximizedHostView>();
            int  idx      = parent.IndexOfChild(view);
            Rect position = view.position;

            parent.RemoveChild(view);
            parent.AddChild(maximizedHostView, idx);
            maximizedHostView.actualView = win;
            maximizedHostView.position   = position;
            return(view);
        }
All Usage Examples Of UnityEditor.View::RemoveChild