Пример #1
0
    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;
        }
    }
Пример #2
0
    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;
        }
    }
Пример #3
0
 void SetState(PTCharacter.State nextState)
 {
     if (CanEnterState(nextState))
     {
         LeaveState(nextState);
         EnterState(nextState);
         stateTimer = 0;
         currState  = nextState;
     }
 }
Пример #4
0
 bool CanEnterState(PTCharacter.State nextState)
 {
     return(true);
 }