Esempio n. 1
0
        public TreeNodeObject AddNode(string _name, TreeNodeObject _parent = null)
        {
            GameObject gameObject = (GameObject)Object.Instantiate <GameObject>((M0)this.m_ObjectNode);

            gameObject.SetActive(true);
            gameObject.get_transform().SetParent(this.m_ObjectRoot.get_transform(), false);
            TreeNodeObject component = (TreeNodeObject)gameObject.GetComponent <TreeNodeObject>();

            component.textName = _name;
            if (Object.op_Implicit((Object)_parent))
            {
                component.SetParent(_parent);
            }
            else
            {
                this.m_TreeNodeObject.Add(component);
            }
            return(component);
        }
Esempio n. 2
0
 public void DeleteNode(TreeNodeObject _node)
 {
     if (!_node.enableDelete)
     {
         return;
     }
     _node.SetParent((TreeNodeObject)null);
     this.m_TreeNodeObject.Remove(_node);
     if (_node.onDelete != null)
     {
         _node.onDelete();
     }
     this.DeleteNodeLoop(_node);
     if (this.m_TreeNodeObject.Count != 0)
     {
         return;
     }
     this.scrollRect.set_verticalNormalizedPosition(1f);
 }
Esempio n. 3
0
 public void SetParent(TreeNodeObject _node, TreeNodeObject _parent)
 {
     if (Object.op_Equality((Object)_node, (Object)null) || !_node.enableChangeParent || this.CheckNode(_node) && Object.op_Equality((Object)_parent, (Object)null) || !_node.SetParent(_parent))
     {
         return;
     }
     this.RefreshHierachy();
     ((MonoBehaviour)this.m_TreeRoot).Invoke("SetDirty", 0.0f);
     if (this.onParentage == null)
     {
         return;
     }
     this.onParentage(_parent, _node);
 }