IEnumerator AttackState() { while (true) { Debug.Log("AttackState"); if (Input.GetKey(KeyCode.A)) { Debug.Log("NextState : Idle"); State = SSTate.Idle; break; } yield return(null); } NextState(); }
IEnumerator IdleState() { yield return(new WaitForSeconds(3)); while (true) { Debug.Log("IdleState"); if (Input.GetKey(KeyCode.A)) { Debug.Log("NextState : Attack"); State = SSTate.Attack; break; } yield return(null); } NextState(); }