void EnterState(PTCharacter.State nextState) { switch (nextState) { case State.INVALID: break; case State.IDLE: SetMotion(MotionState.IDLE); break; case State.RUN: SetMotion(MotionState.RUN); break; case State.HIT: SetMotion(MotionState.HIT); break; case State.ATTACK: SetMotion(MotionState.ATTACK); break; case State.CLIMB: SetMotion(MotionState.CLIMB); break; default: break; } }
void LeaveState(PTCharacter.State nextState) { switch (currState) { case State.INVALID: break; case State.IDLE: break; case State.RUN: break; case State.HIT: break; case State.ATTACK: break; case State.CLIMB: break; default: break; } }
void SetState(PTCharacter.State nextState) { if (CanEnterState(nextState)) { LeaveState(nextState); EnterState(nextState); stateTimer = 0; currState = nextState; } }
bool CanEnterState(PTCharacter.State nextState) { return(true); }