public void Terminate()
 {
     if (m_State != null)
     {
         m_State.StateEnd();
         m_State = null;
     }
     m_bEnd = true;
 }
 public void SetState(ISceneState State)
 {
     Debug.Log("SetState : " + State.ToString());
     if (m_State != null)    //直接把已有的State Terminate 掉
     {
         m_State.StateEnd();
     }
     m_bRunBegin = true;
     m_State     = State;
     m_State.SetSceneController(this);
     m_State.StateBegin();
 }
        public void TransTo(ISceneState nextState)
        {
            if (m_bEnd)
            {
                Debug.LogError("[StateController] has been terminated");
                return;
            }
            if (!m_bRunBegin)
            {
                Debug.LogError("[StateController] has been started");
                return;
            }

            Debug.Log("[StateController] TransTo: " + m_State.ToString());
            SetState(nextState);
        }