// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { astarBoid = animator.GetComponent <AStarBoid>(); astarBoid.isStopped = false; //turn path following on boid = animator.GetComponent <Boid>(); boid.enabled = false; //turn off kinetic boidFeel = animator.GetComponentInChildren <BoidFeeling>(); }
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { astarBoid = animator.GetComponent <AStarBoid>(); astarBoid.isStopped = true; //turn off astar boid = animator.GetComponent <Boid>(); animator.transform.rotation = Quaternion.Euler(Vector3.zero); //reset rotation to face Z-Axis boid.enabled = true; //turn on kinetic boidFeel = animator.GetComponentInChildren <BoidFeeling>(); }