示例#1
0
    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";
                }
            });
        }
    }