UnityEditor.MemoryTreeList.SetRoot C# (CSharp) Méthode

SetRoot() public méthode

public SetRoot ( MemoryElement root ) : void
root MemoryElement
Résultat void
        public void SetRoot(MemoryElement root)
        {
            MemoryElement oldRoot = this.m_Root;
            this.m_Root = root;
            if (this.m_Root != null)
            {
                this.m_Root.ExpandChildren();
            }
            if (this.m_DetailView != null)
            {
                this.m_DetailView.SetRoot(null);
            }
            if ((oldRoot != null) && (this.m_Root != null))
            {
                this.RestoreViewState(oldRoot, this.m_Root);
            }
        }

Usage Example

Exemple #1
0
        public void SetRoot(MemoryElement root)
        {
            MemoryElement oldRoot = m_Root;

            m_Root = root;
            if (m_Root != null)
            {
                m_Root.ExpandChildren();
            }
            if (m_DetailView != null)
            {
                m_DetailView.SetRoot(null);
            }

            // Attempt to restore the old state of things by walking the old tree
            if (oldRoot != null && m_Root != null)
            {
                RestoreViewState(oldRoot, m_Root);
            }
        }