void StartGame() { ProcedureManager.ChangeProcedure <Procedure_Launch>(); //SceneManager.LoadScene("Init"); RegisterGlobalMessage(); }
protected override void OnUpdate() { base.OnUpdate(); if (progress >= 100) { ProcedureManager.ChangeProcedure <Procedure_Login>(); } progress += 3; sliderProgress.value = progress / 100f; }
protected override void OnUpdate() { base.OnUpdate(); if (lastLoadState != loadState) { lastLoadState = loadState; switch (loadState) { case LoadState.None: loadState = LoadState.CheckValid; break; case LoadState.CheckValid: SceneTableSetting setting = SceneTableSettings.Get(nextSceneID); if (setting == null) { Debug.LogError("要加载的场景不存在表中"); loadState = LoadState.Failed; return; } sceneTable = setting; loadState = LoadState.CloseForms; break; case LoadState.CloseForms: Game.UI.CloaseAllForm(Table.Id); loadState = LoadState.LoadScene; break; case LoadState.LoadScene: LoadScene(nextSceneID); break; case LoadState.ClearMemery: ClearMemery(); loadState = LoadState.InitNextProcedure; break; case LoadState.InitNextProcedure: if (sceneTable.Procedure != "NULL") { ProcedureManager.ChangeProcedure(sceneTable.Procedure); } break; case LoadState.Success: Game.Sound.StopAll(sceneTable.BGM); Game.Sound.Play(sceneTable.BGM); break; case LoadState.Failed: break; default: break; } } if (progress < 100) { progress += 3; } if (progress >= 100f * ((float)loadState / (float)LoadState.Success)) { progress = 100f * ((float)loadState / (float)LoadState.Success); } sliderProgress.value = progress / 100f; if (progress >= 100f) { Game.UI.CloseForm <WND_Loading>(); } }
void ChangeScene(int sceneId) { ProcedureManager.ChangeProcedure <Procedure_ChangeScene>(sceneId); }