示例#1
0
    IEnumerator AttackState()
    {
        while (true)
        {
            Debug.Log("AttackState");

            if (Input.GetKey(KeyCode.A))
            {
                Debug.Log("NextState : Idle");
                State = SSTate.Idle;
                break;
            }
            yield return(null);
        }

        NextState();
    }
示例#2
0
    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();
    }