UnityEditor.View.AddChild C# (CSharp) Method

AddChild() public method

public AddChild ( View child ) : void
child View
return void
        public void AddChild(View child)
        {
            this.AddChild(child, this.m_Children.Length);
        }

Same methods

View::AddChild ( View child, 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::AddChild