예제 #1
0
 // Update is called once per frame
 void Update()
 {
     if (currentState != oldState)
     {
         stateMachine.Change(currentState);
     }
     oldState = currentState;
     stateMachine.Update();
 }
예제 #2
0
    // Use this for initialization
    void Start()
    {
        enterEffectState = new EnterEffectState();
        playState        = new PlayState();
        deadState        = new DeadState();
        clearState       = new ClearState();

        currentState = State_StageSequence.ENTER;
        //oldState = currentState;
        oldState = State_StageSequence.START;

        stateMachine.Add(State_StageSequence.ENTER, enterEffectState.StageEnter, enterEffectState.StageUpdate, enterEffectState.StageExit);
        stateMachine.Add(State_StageSequence.PLAY, playState.StageEnter, playState.StageUpdate, playState.StageExit);
        stateMachine.Add(State_StageSequence.DEAD, deadState.StageEnter, deadState.StageUpdate, deadState.StageExit);
        stateMachine.Add(State_StageSequence.EXIT, clearState.StageEnter, clearState.StageUpdate, clearState.StageExit);
    }