Exemplo n.º 1
0
 private void OnDestroy()
 {
     m_graph.OnNodeDeselect(this);
     foreach (var child in m_children)
     {
         BTEditorGraphNode.DestroyImmediate(child);
     }
 }
Exemplo n.º 2
0
 public void OnDelete()
 {
     if (m_parent != null)
     {
         m_parent.RemoveChild(this);
         BTEditorGraphNode.DestroyImmediate(this);
     }
 }
Exemplo n.º 3
0
        public void SetBehaviourTree(BehaviourTree behaviourTree)
        {
            if (m_masterRoot != null)
            {
                BTEditorGraphNode.DestroyImmediate(m_masterRoot);
                m_masterRoot = null;
                m_rootStack.Clear();
            }

            m_isBehaviourTreeReadOnly = behaviourTree.ReadOnly;
            m_masterRoot = BTEditorGraphNode.CreateRoot(this, behaviourTree.Root);
            m_rootStack.Push(m_masterRoot);
            BTUndoSystem.Clear();
        }
Exemplo n.º 4
0
        private void DestroyChildren()
        {
            for (int i = 0; i < m_children.Count; i++)
            {
                BTEditorGraphNode.DestroyImmediate(m_children[i]);
            }

            if (m_node is Composite)
            {
                ((Composite)m_node).RemoveAllChildren();
            }
            else if (m_node is Decorator)
            {
                ((Decorator)m_node).SetChild(null);
            }

            m_children.Clear();
        }
Exemplo n.º 5
0
 private void OnDestroy()
 {
     BTEditorGraphNode.DestroyImmediate(m_masterRoot);
     m_masterRoot = null;
     m_rootStack.Clear();
 }