Beispiel #1
0
 public void ChangeState(State <T> newState)
 {
     if (m_pCurrentState != null)
     {
         Log.Print("entity:{0} [{1}]->[{2}]", m_entity.GetID(), m_pCurrentState?.GetName(), newState.GetName());
         m_pPreState = m_pCurrentState;
         m_pCurrentState.Exit(m_entity);
         m_pCurrentState = newState;
         m_pCurrentState.Enter(m_entity);
     }
 }