protected new IEnumerator AttackState() { GetComponent <Animator>().Play("Idle"); while (state == State.Attack) { GetComponent <Animator>().SetLayerWeight(1, 1.0f); GetComponent <Animator>().Play("CastFireball"); if (bossBehaviour.getPhase() == 2) { GameObject projectile = projectileSummonerBehaviour.Summon(0.0f); yield return(new WaitForSeconds(1.3f)); projectile.GetComponent <ProjectileBehaviour>().Throw(10.0f); } else { yield return(new WaitForSeconds(1.3f)); } bossBehaviour.castAoe(); if (state == State.Attack) { GetComponent <Animator>().SetLayerWeight(1, 0.0f); state = State.AttackEnd; } yield return(new WaitForSeconds(0.7f)); } GoToNextState(); }