void Updating() { if (!soundsStarted) { soundsStarted = true; StartCoroutine("EngardeSound"); } if (!enemy.GetAttackTimer()) { enemy.TimeBeforeAttackStart(); } enemy.Engarde(); //TRANSITIONS GO HERE if (enemy.GetTimerSetOff()) { enemy.SetTimerSetOff(false); enemy.ResetAnimatorBools(enemy.anim); enemy.anim.SetBool("attack", true); ToAttackState(); } else if (enemy.EnemyIsTooClose()) { GetComponent <Rigidbody>().AddForce(-transform.forward * 5, ForceMode.Impulse); } else if ((enemy.PlayerInFieldOfView() || enemy.PlayerDetected()) && enemy.EnemyIsOutsideEngardeDistance()) { enemy.ResetAnimatorBools(enemy.anim); enemy.anim.SetBool("chase", true); ToChaseState(); } else if (!enemy.PlayerInFieldOfView() && !enemy.PlayerDetected() && !enemy.PlayerIsWithinStrikingDistance()) { enemy.ResetAnimatorBools(enemy.anim); enemy.anim.SetBool("patrol", true); ToPatrolState(); } else if (enemy.PlayerIsAttacking() && enemy.WillAttemptToCounter() && enemy.PlayerIsWithinStrikingDistance()) { enemy.ResetAnimatorBools(enemy.anim); enemy.anim.SetBool("block", true); ToBlockSwordState(); } else { ToEngardeState(); } }