Пример #1
0
    StateSuper <T> mGlobalState; // FSM이 갱신될때마다 호출

    public StateMachine(T mEntity)
    {
        this.mEntity       = mEntity;
        this.mCurrentState = null;
        this.mPrevState    = null;
        this.mGlobalState  = null;
    }
Пример #2
0
 // Change
 public void ChangeState(StateSuper <T> newState)
 {
     if (newState == null)
     {
         return;
     }
     if (mCurrentState != null)
     {
         mPrevState = mCurrentState;
         mCurrentState.Exit(mEntity);
     }
     mCurrentState = newState;
     mCurrentState.Enter(mEntity);
 }
Пример #3
0
 public bool isSameState(StateSuper <T> state)
 {
     return((mCurrentState == state) ? true : false);
 }
Пример #4
0
 public void SetGlobalState(StateSuper <T> t)
 {
     mGlobalState = t;
 }
Пример #5
0
 public void SetPrevState(StateSuper <T> t)
 {
     mPrevState = t;
 }
Пример #6
0
 // SetState
 public void SetCurrentState(StateSuper <T> t)
 {
     mCurrentState = t;
 }