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); }
public virtual void UpdateBlackboard(BTBlackboard blackboard) { var btv = blackboard.Value <T>(varName); if (btv != null) { btv.Set(varValue); } }
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]); } } }
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(); }
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 }
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); }