예제 #1
0
    void SetState()
    {
        // DIE
        if (die)
            state = PlayerStates.State.Die;

        // WALK
        if (state == PlayerStates.State.Idle && isWalking)
            state = PlayerStates.State.Walk;

        if (state == PlayerStates.State.Walk && !isWalking)
            state = PlayerStates.State.Idle;

        // ATTACK
        if (state == PlayerStates.State.Idle && isAttacking)
            state = PlayerStates.State.Attack;

        if (state == PlayerStates.State.Walk && isAttacking)
            state = PlayerStates.State.Attack;

        if (state == PlayerStates.State.Attack && !isAttacking)
            state = PlayerStates.State.Idle;
    }
예제 #2
0
 void Update()
 {
     currentState = pSM.GetState ();
     Animate ();
 }
예제 #3
0
 void Start()
 {
     state = PlayerStates.State.Idle;
 }