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); }
public void ShowError(FileStatus status) { string note = ""; if (status == FileStatus.TimeOut || status == FileStatus.NoInternet) { note = LocalizedManager.Key("base_DownloadFirstTime") + "\n" + "\n"; } if (status == FileStatus.TimeOut) { note += LocalizedManager.Key("base_DownloadTimeOut"); } else if (status == FileStatus.NoInternet) { note += LocalizedManager.Key("base_PleaseCheckYourInternetConnection"); } else { note += LocalizedManager.Key("base_SomethingWrongs") + "\n ERROR #" + status; } PopupMes.Show("Oops...!", note, "Ok"); }