Beispiel #1
0
 void SetState(State nextState)
 {
     if (m_currentState.End != null)
     {
         m_currentState.End();
     }
     m_currentState = m_stateDict[nextState];
     if (m_currentState.Start != null)
     {
         m_currentState.Start();
     }
 }
Beispiel #2
0
 public void ChangeState(FSMState <T> newState)
 {
     if (newState != null)
     {
         if (current != null)
         {
             current.End(owner, this);
         }
         current = newState;
         current.Begin(owner, this);
     }
 }
Beispiel #3
0
    public void SetEnemyState(FSMState state)
    {
        if (mState != null)
        {
            state.End();
        }

        mState = state;
        if (mState != null)
        {
            mState.Start();
        }
    }