// 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) { this.animator = animator; state = animator.GetComponentInChildren <TurretState> (); sp = animator.GetComponent <TurretSP> (); update = animator.GetComponentInChildren <LineUpdate> (); sp.turretSP.SetNone(); update.DisableLine(); }
// 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) { // set enemy sprites this.animator = animator; sp = animator.GetComponent <TurretSP> (); state = animator.GetComponentInChildren <TurretState> (); if (lineUpdate) { lineUpdate.EnableLine(); } if (shoot) { shoot.StopShoot(); UpdateTargetPos(); } shooting = false; sp.SetEnemySprite(); state.SetTargetsToPlayer(); }