override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { mAgentAi = animator.gameObject.GetComponent <AgentAi>(); mAgentAi.mAgent.m_Target = FlockManager.getTarget(mAgentAi.mAgent.m_Agent).m_Target; }
// OnStateUpdate is called on each Update frame between OnStateEnter and OnStateExit callbacks override public void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { mAgentAi.mAgent.m_Target = FlockManager.getTarget(mAgentAi.mAgent.m_Agent).m_Target; mAgentAi.mAgent.pursuit(mAgentAi.mAgent.m_Agent.transform.position); }
public void OnTriggerEnter(Collider other) { FlockManager.getListBot().Remove(other.gameObject.GetComponent <Bot>()); Destroy(other.gameObject); m_Target = FlockManager.getTarget(m_Agent).m_Target; }
void Update() { m_Target = FlockManager.getTarget(m_Agent).m_Target; }
// OnStateUpdate is called on each Update frame between OnStateEnter and OnStateExit callbacks override public void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { mAgentAi.mAgent.m_Target = FlockManager.getTarget(mAgentAi.mAgent.m_Agent).m_Target; mAgentAi.mAgent.wander(); }