public void SetCurrentTree(GBTNode tree) { _bb.SetInt("bbIdleCnt", 3); _root = tree; _root.Transition(); _root.SetBB(_bb); _root.SetKey("root:" + tree.ToString()); }
// 优先级,越大优先级越高 public CTR_PrioritizedSelector Add(GBTNode child, int weight) { int index = _children.Count; if (null != Add(child)) { _indexPriority.Add(index, weight); } return(this); }
public GBTCtrNode Add(GBTNode child) { if (_maxChild <= _children.Count) { return(null); } _children.Add(child); child.SetParent(this); child.SetBB(_bb); return(this); }
public void SwitchTo(GBTNode tree) { if (null == tree) { return; } if (_root != null) { _root.Transition(); } SetCurrentTree(tree); }
public GBehaviorTree() { _bb = new BlackBoard(); _root = null; }
public void SetParent(GBTNode parent) { _parent = parent; SetKey(parent.GetKey()); }
public GBTNode() { _state = ENodeState.init; _parent = null; }