IEnumerator attacking() { while (myState == states.ATK) { if (knightControl.ultimateManager.isFull()) { knightControl.preformUltimate(); while (knightControl.isPrefromUlti) { yield return(new WaitForSeconds(0.125f)); knightControl.preformUltimate(); if (isDeath) { ReportDeath(); break; } } } knightControl.performAttack(); yield return(new WaitUntil(() => !knightControl.isAtk)); if (isTakenDamage) { knightControl.performBlock(); isTakenDamage = false; } while (knightControl.isBlocking) { if (knightControl.ultimateManager.isFull()) { isTakenDamage = false; } yield return(new WaitForSeconds(1f)); knightControl.performAttack(); yield return(new WaitUntil(() => !knightControl.isAtk)); if (!isTakenDamage) { knightControl.performUnBlock(); yield return(new WaitForSeconds(0.5f)); } else { isTakenDamage = false; } if (isDeath) { ReportDeath(); break; } } if (isDeath) { ReportDeath(); break; } } }