/// <summary>Inits the blackboard for the current graph.</summary> protected void InitBlackboard() { // Set up blackboard. _blackboard = ScriptableObject.CreateInstance(typeof(AIBlackboard)) as AIBlackboard; SetInBlackboard("GameObject", gameObject); // Init tree. _graph.Init(_blackboard); // Execute on tree init event. if (OnGraphInit != null) { OnGraphInit(); } }
/// <summary> /// Run the AIGraph in the given blackboard. /// </summary> /// <param name="blackboard"> The blackboard use to execute the graph.</param> public abstract AIGraphResult Run(AIBlackboard blackboard);
/// <summary> /// Initialize the AIGraph in the given blackboard. /// </summary> /// <param name="blackboard"> The blackboard use to initialize the graph.</param> public abstract void Init(AIBlackboard blackboard);