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; }
void Update() { currentState = pSM.GetState (); Animate (); }
void Start() { state = PlayerStates.State.Idle; }