Example #1
0
 public void StateUpdate()
 {
     if (mAO != null && mAO.isDone == false)
     {
         return;
     }
     if (mIsRunStart == false && mAO != null && mAO.isDone == true)
     {
         mState.StateStart();
         mIsRunStart = true;
     }
     if (mState != null)
     {
         mState.StateUpdate();
     }
 }
Example #2
0
 public void ChangeSceneState()
 {
     if (_scene_next != null && GameSystemManager.GetSystem <ScreenEffect>().screen_covered)
     {
         _scene_next.ChangeScene();
         _scene_pre  = _scene_now;
         _scene_now  = _scene_next;
         _scene_next = null;
         _scene_now.StateStart();
         progress = 0;
         loading  = false;
         if (_scene_pre != null)
         {
             _scene_pre.StateExit();
         }
     }
 }
Example #3
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;
     }
 }
    /// <summary>
    /// 状态的更新
    /// </summary>
    public void UpdateState()
    {
        //正在进行切换
        if (asOpe != null && !asOpe.isDone)
        {
            return;
        }

        //如果切换完毕
        if (asOpe != null && asOpe.isDone && !isFinishStart)
        {
            mState.StateStart();
            isFinishStart = true;
        }

        if (mState != null)
        {
            mState.StateUpdate();
        }
    }
    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;
        }
    }