void Update() { // Update all agent sensors agent.World.Resources = FindObjectsOfType <Resource>(); // Execute behaviour tree. behaviourTree.Run(ref agent, ref behaviourTreeState); }
void Update() { // Update agent sensors. agent.World.Resources = FindObjectsOfType <Resource>(); // Execute finite state machine. // Every update we pass by reference the agent and the last state. fsm.Run(ref agent, ref fsmRuntimeState); }