public void ResetStatsButton_Pressed() { PopupManager.Get().NewQuestion(PopupType.Warning, "", "Reset Your Local and Server Stats?", (PopupQuestionResult result) => { if (result == PopupQuestionResult.Accept) { PlayerPrefs.DeleteAll(); StartCoroutine(TaskExtension.YieldWait(UserDatabase.Get().PostUserHighScore(0))); } }); }
IEnumerator LoadUserDatas() { PopupManager.Get().OpenLoading("", "Loading..."); Task <UserData[]> task = UserDatabase.Get().GetAllUserData(); yield return(TaskExtension.YieldWait(task)); if (task.IsCompleted) { UserData[] userDatas = task.Result; if (userDatas.Length > 0) { foreach (UserData userData in userDatas) { ScoreBoardEntry entry = Instantiate(scoreBoardEntryPrefab, scoreBoardTable); entry.Init(userData.iconURL, userData.name, userData.highScore); scoreBoardEntries.Add(entry); } } } PopupManager.Get().CloseLoading(); }