コード例 #1
0
 public override void OnPrepare(BehaviourTreeRunner.AssetBinder binder, BTNode node)
 {
     base.OnPrepare(binder, node);
     blackboard = binder.Blackboard;
     from       = blackboard.GetIndex(m_CopyFrom);
     to         = blackboard.GetIndex(m_CopyTo);
 }
コード例 #2
0
 private void OnDisable()
 {
     if (mBinder != null)
     {
         mBinder.Dispose();
         mBinder = null;
     }
 }
コード例 #3
0
 public override void OnPrepare(BehaviourTreeRunner.AssetBinder asset, BTNode node)
 {
     base.OnPrepare(asset, node);
     mExecIndex = new int[mChildren.Length];
     for (int i = 0; i < mExecIndex.Length; i++)
     {
         mExecIndex[i] = i;
     }
 }
コード例 #4
0
 public override void OnPrepare(BehaviourTreeRunner.AssetBinder binder, BTNode node)
 {
     base.OnPrepare(binder, node);
     mLoopers = new BehaviourLooper[node.ChildrenCount];
     for (int i = 0; i < mLoopers.Length; i++)
     {
         mLoopers[i] = binder.Looper.CreateSubLooper();
         mLoopers[i].SetBehaviuor(node.ChildAt(i).Asset as IBTNode);
     }
 }
コード例 #5
0
 public override void OnPrepare(BehaviourTreeRunner.AssetBinder asset, BTNode node)
 {
     base.OnPrepare(asset, node);
     mChildren = new IBTNode[node.ChildrenCount];
     for (int i = 0; i < mChildren.Length; i++)
     {
         var child = node.ChildAt(i);
         mChildren[i] = child == null ? null : child.Asset as IBTNode;
     }
 }
コード例 #6
0
 public void Prepare(BehaviourTreeRunner.AssetBinder binder)
 {
     mServices.Clear();
     for (int i = 0; i < m_BTNodes.Count; i++)
     {
         m_BTNodes[i].Asset.OnPrepare(binder, m_BTNodes[i]);
         if (m_BTNodes[i].Asset is IBTService)
         {
             mServices.Add((IBTService)m_BTNodes[i].Asset);
         }
     }
 }
コード例 #7
0
 public override void OnPrepare(BehaviourTreeRunner.AssetBinder binder, BTNode node)
 {
     base.OnPrepare(binder, node);
     if (m_BehaviourTree != null)
     {
         mBinder = BehaviourTreeRunner.AssetBinder.NewSubBinder(binder);
         if (mBinder != null)
         {
             mBinder.Name = NameSubtree(this);
         }
     }
 }
コード例 #8
0
        public override void OnPrepare(BehaviourTreeRunner.AssetBinder binder, BTNode node)
        {
            Identify = node.Identify;
            var p = node.Parent; // TreeAsset.GetNodeById(node.parentId);

            Parent = p == null ? null : p.Asset as IBTNode;
            for (int i = 0; i < m_ConditionIds.Count; i++)
            {
                var cond = TreeAsset.GetNodeById(m_ConditionIds[i]);
                if (cond != null)
                {
                    mConditions.Add(cond.Asset as ICondition);
                    var decor = cond.Asset as IBTNodeDecorator;
                    if (decor != null)
                    {
                        mDecorators.Add(decor);
                    }
                }
            }
        }
コード例 #9
0
 public override void OnPrepare(BehaviourTreeRunner.AssetBinder binder, BTNode node)
 {
     base.OnPrepare(binder, node);
     mBlackboard    = binder.Blackboard;
     mPropertyIndex = string.IsNullOrEmpty(m_BlackboardProperty) ? -1 : mBlackboard.GetIndex(m_BlackboardProperty);
 }
コード例 #10
0
 public override void OnPrepare(BehaviourTreeRunner.AssetBinder asset, BTNode node)
 {
     base.OnPrepare(asset, node);
     Init();
 }
コード例 #11
0
 public override void OnPrepare(BehaviourTreeRunner.AssetBinder binder, BTNode node)
 {
     base.OnPrepare(binder, node);
     mBlackboard = binder.Blackboard;
     mIndex      = mBlackboard.GetIndex(m_VariableName);
 }
コード例 #12
0
 public override void OnPrepare(BehaviourTreeRunner.AssetBinder binder, BTNode node)
 {
     base.OnPrepare(binder, node);
     mBlackboardValue = !string.IsNullOrEmpty(m_UseBlackboard) ? binder.Runner.Blackboard.Value <bool>(m_UseBlackboard) : null;
 }
コード例 #13
0
 public abstract void OnPrepare(BehaviourTreeRunner.AssetBinder assetBinder, BTNode node);