SubmitScore() private method

private SubmitScore ( string name, int diff, int health, int hits, int dmg, int wpdmg, int score, string rank ) : IEnumerator
name string
diff int
health int
hits int
dmg int
wpdmg int
score int
rank string
return IEnumerator
示例#1
0
    private void SubmitScore()
    {
        string playerName = SingleScreen.transform.GetChild(8).GetComponentInChildren <TMP_InputField>().text;

        LevelBundles.playerName = SingleScreen.transform.GetChild(8).GetComponentInChildren <TMP_InputField>().text;
        if (!string.IsNullOrWhiteSpace(playerName))
        {
            SingleScreen.transform.GetComponentInChildren <Button>().interactable = false;
            Score score = new Score(playerName, LevelManager.currentLevel.name, LevelStatistics.instance.score, (int)LevelStatistics.instance.time);
            hiddenMenu.text = LevelManager.currentLevel.name + ": " + playerName + " reached " + score.finalScore() + " (base: " + LevelStatistics.instance.score + " time: " + LevelStatistics.instance.time + ")";
            Scores.SubmitScore(score);

            navigationButtons.SetActive(true);
            SetupHighScoreScreen();
        }
        else
        {
            hiddenMenu.text = "Improper Submission";
        }
    }
示例#2
0
 void submit(string track, string time, string name)
 {
     if (scoreSubmitted)
     {
         Debug.Log("Counting");
         Scores.SubmitScore(track, time, name);
         scores = Scores.GetScores(track);
         names  = scores.names;
         times  = scores.times;
         for (int i = 0; i < names.Length; i++)
         {
             if (i == 0)
             {
                 leaderboard.text = i + 1 + ". " + names[i] + "  " + times[i] + "\n";
             }
             else
             {
                 leaderboard.text += i + 1 + ". " + names[i] + "  " + times[i] + "\n";
             }
         }
         winner    = false;
         text.text = "Enter Your Name:\n\n\n\n\n\n_ _ _ _ _ _ _ _ _ _";
     }
 }