private IEnumerator DoPrepairDataToPlay(StageData stage, Action <bool> actionOnDone = null) { UIToast.ShowLoading(randomTip, 5f, UIToast.IconTip); UILoadGame.Init(true, null); while (UILoadGame.currentProcess < 0.1f) { UILoadGame.Process(0, 1, -1, LocalizedManager.Key("base_Loading") + LocalizedManager.Key("base_PleaseWait")); yield return(null); } if (UIToast.Status != UIAnimStatus.IsShow) { UIToast.ShowLoading(randomTip, 5f, UIToast.IconTip); } MusicManager.Stop(null, false, 0.25f); if (string.IsNullOrEmpty(currentMode)) { currentMode = modes[0]; } //Init game object elapsedTime = 0f; loadMidiStatus = FileStatus.Download; loadMidiStatus = FileStatus.Success; GameStateManager.Init(null); while (GameStateManager.CurrentState == GameState.Init || UILoadGame.currentProcess < 1) { if (GameStateManager.CurrentState != GameState.Idle && elapsedTime < 5) { UILoadGame.Process(); elapsedTime += Time.deltaTime; yield return(null); } else { yield return(UILoadGame.DoRollBack(() => { UIToast.Hide(); actionOnDone(false); })); yield break; } } UIToast.Hide(); actionOnDone(true); }
private void Reborn() { StopAllCoroutines(); UIToast.Hide(); Hide(() => { DOVirtual.DelayedCall(0.5f, () => { if (rebornType == RebornType.Continue) { GameStateManager.RebornContinue(null); } else { GameStateManager.RebornCheckPoint(null); } }); rebornCount++; }); }