public override void Execute()
 {
     if (mCurrentState != null)
     {
         if (mCurrentState.mStateFlag == ISMStateBase.StateFlag.BeforeEnter)
         {
             mCurrentState.Enter();
         }
         else if (mCurrentState.mStateFlag == ISMStateBase.StateFlag.Executing)
         {
             mCurrentState.Execute();
         }
         else if (mCurrentState.mStateFlag == ISMStateBase.StateFlag.BeforeExit)
         {
             mCurrentState.Exit();
         }
         else if (mCurrentState.mStateFlag == ISMStateBase.StateFlag.AfterExit)
         {
             mCurrentState.ReInit();
             mCurrentState = null;
         }
     }
     else
     {
         if (mStateQueue.Count > 0)
         {
             mCurrentState = mStateQueue.Dequeue();
         }
         else
         {
             EndSelf();
         }
     }
 }
    public virtual void Update()
    {
        for (int i = 0; i < m_states.Count; i++)
        {
            ISMState <T> state = m_states[i];
            if (state.mStateFlag == ISMStateBase.StateFlag.Executing)
            {
                if (state.IsPause() == false)
                {
                    state.Execute();
                }
            }

            if (state.mStateFlag == ISMStateBase.StateFlag.BeforeExit)
            {
                Remove(state);

                state.Exit();
            }
        }
    }