Ejemplo n.º 1
0
        public override void OnUpdate(IFsm <IProcedureManager> procedureOwner)
        {
            if (m_StartGame)
            {
                procedureOwner.SetData(Constant.ProcedureData.NextSceneId, new VarInt(GameEntry.Config.GetInt("Scene.Main")));
                procedureOwner.SetData(Constant.ProcedureData.GameMode, new VarInt((int)GameMode.Survival));

                RuntimeProcedure.ChangeProcedure <HotProcedureChangeScene>(procedureOwner);
            }
        }
        public override void OnUpdate(IFsm <IProcedureManager> procedureOwner)
        {
            if (!m_IsChangeSceneComplete)       //检查是否完成
            {
                return;
            }

            //清空对象池
            GameEntry.ObjectPool.ReleaseAllUnused();

            //切换流程
            if (m_ChangeToMenu)
            {
                RuntimeProcedure.ChangeProcedure <HotProcedureMenu>(procedureOwner);
            }
            else
            {
                RuntimeProcedure.ChangeProcedure <HotProcedureMain>(procedureOwner);
            }
        }
        public override void OnUpdate(IFsm <IProcedureManager> procedureOwner)
        {
            if (m_CurrentGame != null && !m_CurrentGame.IsGameOver)
            {
                m_CurrentGame.Update(HotfixEntry.deltaTime, HotfixEntry.unscaleDeltaTime);
                return;
            }

            if (!m_GotoMenu)
            {
                m_GotoMenu             = true;
                m_GotoMenuDelaySeconds = 0f;
            }

            m_GotoMenuDelaySeconds += HotfixEntry.deltaTime;
            if (m_GotoMenuDelaySeconds >= GameOverDelayedSeconds)
            {
                procedureOwner.SetData <VarInt>(Constant.ProcedureData.NextSceneId, new VarInt(GameEntry.Config.GetInt("Scene.Menu")));
                RuntimeProcedure.ChangeProcedure <HotProcedureChangeScene>(procedureOwner);
            }
        }