Exemplo n.º 1
0
 /// <summary>
 /// Adds new behaviour tree to this blackboard.
 /// </summary>
 /// <param name="tree">New behaviour tree for current blackboard.</param>
 /// <returns>True if new tree was added. Otherwise false.</returns>
 public bool AddTree(AiTree tree)
 {
     if (_trees.Contains(tree)) {
         return false;
     }
     _trees.Add(tree);
     return true;
 }
Exemplo n.º 2
0
 /// <summary>
 /// Adds new behaviour tree to this blackboard.
 /// </summary>
 /// <param name="tree">New behaviour tree for current blackboard.</param>
 /// <returns>True if new tree was added. Otherwise false.</returns>
 public bool AddTree(AiTree tree)
 {
     if (_trees.Contains(tree))
     {
         return(false);
     }
     _trees.Add(tree);
     return(true);
 }
Exemplo n.º 3
0
 public void RebuildTreeView(AiTree tree)
 {
     _tree = tree;
     if (_tree == null) {
         return;
     }
     if(_nodeDrawers != null) {
         foreach(NodeDrawer drawer in _nodeDrawers) {
             drawer.Node.OnDebugResult -= DebugResult;
         }
     }
     _nodeDrawers = new List<NodeDrawer>();
     for (int i = 0; i < _tree.Nodes.Count; ++i) {
         _tree.Nodes[i].OnDebugResult += DebugResult;
         _nodeDrawers.Add(new NodeDrawer(_tree.Nodes[i], _tree.Root == _tree.Nodes[i]));
     }
 }
Exemplo n.º 4
0
 /// <summary>
 /// Removes behaviour tree from this blackboard.
 /// </summary>
 /// <param name="tree">Tree to remove from current blackboard.</param>
 /// <returns>True if tree was removed. Otherwise false.</returns>
 public bool RemoveTree(AiTree tree)
 {
     return(_trees.Remove(tree));
 }
Exemplo n.º 5
0
 public TreeDrawer(AiTree tree)
 {
     NodeDrawer.OnLeftClicked += NodeLeftClicked;
     NodeDrawer.OnRightClicked += ShowContextMenu;
     RebuildTreeView(tree);
 }
Exemplo n.º 6
0
 /// <summary>
 /// Removes behaviour tree from this blackboard.
 /// </summary>
 /// <param name="tree">Tree to remove from current blackboard.</param>
 /// <returns>True if tree was removed. Otherwise false.</returns>
 public bool RemoveTree(AiTree tree)
 {
     return _trees.Remove(tree);
 }