Exemplo n.º 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);
 }
Exemplo n.º 2
0
        public virtual void UpdateBlackboard(BTBlackboard blackboard)
        {
            var btv = blackboard.Value <T>(varName);

            if (btv != null)
            {
                btv.Set(varValue);
            }
        }
Exemplo n.º 3
0
        public virtual void UpdateBlackboard(BTBlackboard blackboard)
        {
            var btv = blackboard.List <T>(name);

            if (btv != null)
            {
                for (int i = 0; i < value.Count; i++)
                {
                    btv.Add(value[i]);
                }
            }
        }
Exemplo n.º 4
0
 protected virtual void Awake()
 {
     sInstance = this;
     if (m_DontDestroyOnLoad)
     {
         DontDestroyOnLoad(gameObject);
     }
     if (m_GlobalBlackboard == null)
     {
         mBlackboard = new BTBlackboard();
     }
     else
     {
         mBlackboard = new BTBlackboard(m_GlobalBlackboard);
     }
     mTasks       = new Dictionary <string, BTGenerator <BTTaskBase> >();
     mConditions  = new Dictionary <string, BTGenerator <BTConditionBase> >();
     mServices    = new Dictionary <string, BTGenerator <BTServiceBase> >();
     mControllers = new Dictionary <string, BTGenerator <BTNodeBase> >();
     OnInit();
 }
Exemplo n.º 5
0
        protected virtual void Start()
        {
            mServiceDeltaTime = m_ServiceInterval;
            mServiceTimer     = 0;

            if (m_Blackboard != null)
            {
                Blackboard = new BTBlackboard(m_Blackboard);
            }
            else
            {
                Blackboard = new BTBlackboard();
            }
            SetAsset(m_BehaviourAsset);
#if UNITY_EDITOR
            if (m_BreakAtStart)
            {
                Debug.Break();
            }
#endif
        }
Exemplo n.º 6
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);
 }
 public override void OnPrepare(BehaviourTreeRunner.AssetBinder binder, BTNode node)
 {
     base.OnPrepare(binder, node);
     mBlackboard = binder.Blackboard;
     mIndex      = mBlackboard.GetIndex(m_VariableName);
 }