예제 #1
0
 private void OnDestroy()
 {
     m_graph.OnNodeDeselect(this);
     foreach (var child in m_children)
     {
         BTEditorGraphNode.DestroyImmediate(child);
     }
 }
예제 #2
0
 public void OnDelete()
 {
     if (m_parent != null)
     {
         m_parent.RemoveChild(this);
         BTEditorGraphNode.DestroyImmediate(this);
     }
 }
예제 #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();
        }
예제 #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();
        }
예제 #5
0
 private void OnDestroy()
 {
     BTEditorGraphNode.DestroyImmediate(m_masterRoot);
     m_masterRoot = null;
     m_rootStack.Clear();
 }