public void Entry() { AudioSE.button = true; string name = nameInput.text; string pass = passInput.text; if (name == "" || pass == "") { entryText.text = "InputPlease"; } else if (!PlayerPrefs.HasKey(((DiffName)(Select.diff)).ToString() + "Kill")) { entryText.text = "NoRecordData"; } else { entryText.text = "EntryNow"; FirebaseManager.RankingDataWrite(path, name, pass).ContinueWith(rankingDataWrite => { if (rankingDataWrite.IsCompleted) { if (rankingDataWrite.Result) { FirebaseManager.RankingDataRead(path).ContinueWith(rankingDataRead => { if (rankingDataRead.IsCompleted) { rankingDataList = rankingDataRead.Result; rankingPage = 0; rankingPageMax = (rankingDataList.Count - 1) / 5; RankingDisplay(rankingDataList); entryText.text = RankingResult(rankingDataList, name); } else { Debug.Log(rankingDataRead.Exception); entryText.text = "Error"; } }); } else { entryText.text = "PasswordMiss"; } } else { Debug.Log(rankingDataWrite.Exception); entryText.text = "Error"; } }); } }
void Start() { string os = TouchOperation.windows ? "Windows" : "Android"; string diffName = ((DiffName)Select.diff).ToString(); path = "Ranking/" + os + "/" + diffName + "/"; rankingPage = 0; rankingPageMax = 0; FirebaseManager.RankingDataRead(path).ContinueWith(rankingDataRead => { if (rankingDataRead.IsCompleted) { rankingDataList = rankingDataRead.Result; rankingPage = 0; rankingPageMax = (rankingDataList.Count - 1) / 5; RankingDisplay(rankingDataList); } else { Debug.Log(rankingDataRead.Exception); } }); }