UnityEditor.SplitView.RemoveChildNice C# (CSharp) Method

RemoveChildNice() public method

public RemoveChildNice ( View child ) : void
child View
return void
        public void RemoveChildNice(View child)
        {
            if (base.children.Length != 1)
            {
                int num = base.IndexOfChild(child);
                float t = 0f;
                if (num == 0)
                {
                    t = 0f;
                }
                else if (num == (base.children.Length - 1))
                {
                    t = 1f;
                }
                else
                {
                    t = 0.5f;
                }
                t = !this.vertical ? Mathf.Lerp(child.position.xMin, child.position.xMax, t) : Mathf.Lerp(child.position.yMin, child.position.yMax, t);
                if (num > 0)
                {
                    View view = base.children[num - 1];
                    Rect position = view.position;
                    if (this.vertical)
                    {
                        position.yMax = t;
                    }
                    else
                    {
                        position.xMax = t;
                    }
                    view.position = position;
                    if (view is SplitView)
                    {
                        ((SplitView) view).Reflow();
                    }
                }
                if (num < (base.children.Length - 1))
                {
                    View view2 = base.children[num + 1];
                    Rect rect6 = view2.position;
                    if (this.vertical)
                    {
                        view2.position = new Rect(rect6.x, t, rect6.width, rect6.yMax - t);
                    }
                    else
                    {
                        view2.position = new Rect(t, rect6.y, rect6.xMax - t, rect6.height);
                    }
                    if (view2 is SplitView)
                    {
                        ((SplitView) view2).Reflow();
                    }
                }
            }
            this.RemoveChild(child);
        }

Usage Example

示例#1
0
        private void KillIfEmpty()
        {
            // if we're empty, remove ourselves
            if (m_Panes.Count != 0)
            {
                return;
            }

            if (parent == null)
            {
                window.InternalCloseWindow();
                return;
            }

            SplitView sw = (SplitView)parent;

            sw.RemoveChildNice(this);

            if (!m_IsBeingDestroyed)
            {
                DestroyImmediate(this, true);
            }

            sw.Cleanup();
        }
All Usage Examples Of UnityEditor.SplitView::RemoveChildNice