示例#1
0
文件: GBTFight.cs 项目: guccang/GBT
        public void SetCurrentTree(GBTNode tree)
        {
            _bb.SetInt("bbIdleCnt", 3);
            _root = tree;
            _root.Transition();

            _root.SetBB(_bb);
            _root.SetKey("root:" + tree.ToString());
        }
示例#2
0
        // 优先级,越大优先级越高
        public CTR_PrioritizedSelector Add(GBTNode child, int weight)
        {
            int index = _children.Count;

            if (null != Add(child))
            {
                _indexPriority.Add(index, weight);
            }
            return(this);
        }
示例#3
0
 public GBTCtrNode Add(GBTNode child)
 {
     if (_maxChild <= _children.Count)
     {
         return(null);
     }
     _children.Add(child);
     child.SetParent(this);
     child.SetBB(_bb);
     return(this);
 }
示例#4
0
文件: GBTFight.cs 项目: guccang/GBT
        public void SwitchTo(GBTNode tree)
        {
            if (null == tree)
            {
                return;
            }

            if (_root != null)
            {
                _root.Transition();
            }

            SetCurrentTree(tree);
        }
示例#5
0
文件: GBTFight.cs 项目: guccang/GBT
 public GBehaviorTree()
 {
     _bb   = new BlackBoard();
     _root = null;
 }
示例#6
0
文件: GBTNode.cs 项目: guccang/GBT
 public void SetParent(GBTNode parent)
 {
     _parent = parent;
     SetKey(parent.GetKey());
 }
示例#7
0
文件: GBTNode.cs 项目: guccang/GBT
 public GBTNode()
 {
     _state  = ENodeState.init;
     _parent = null;
 }