示例#1
0
    public void SetState(SceneState state, int sceneIndex)
    {
        m_bRunBegin = false;
        if (m_State != null)
        {
            m_State.StateEnd();
        }
        LoadScene(sceneIndex);

        m_State = state;
    }
示例#2
0
 public void SetState(SceneState state, bool isLoadScene = true)
 {
     if (mState != null)
     {
         mState.StateEnd();//让上一个场景状态做一下清理工作
     }
     mState = state;
     if (isLoadScene)
     {
         mAO         = SceneManager.LoadSceneAsync(mState.SceneName);
         mIsRunStart = false;
     }
     else
     {
         mState.StateStart();
         mIsRunStart = true;
     }
 }
    public void SetState(SceneState state, bool isLoadScene = true)
    {
        //结束当前状态
        if (mState != null)
        {
            mState.StateEnd();
        }

        mState = state;

        if (isLoadScene)
        {
            asOpe         = SceneManager.LoadSceneAsync(mState.SceneName);
            isFinishStart = false;
        }
        else
        {
            //因为初始场景是默认加载的,无需切换
            mState.StateStart();
            isFinishStart = true;
        }
    }