/// <summary> /// Callback for when a particular user's score is retrieved. /// </summary> private void UpdateUserScoreDisplay(object sender, UserScoreArgs args) { if (args.Score == null) { UserScoreText.text = "none"; return; } UserScoreText.text = args.Score.Score.ToString(); // UpdateUserScoreDisplay is called after AddScore button is clicked manually, or for // the very last score added when adding a random number of score records. // If subscribed to ScoreAdded, remove the subscription until the next button press or // batch call. leaderboard.ScoreAdded -= UpdateUserScoreDisplay; }
/// <summary> /// When a new score is added, update the message text with the total # of scores /// added since startup. /// </summary> private void ScoreAdded(object sender, UserScoreArgs args) { scoresAdded++; MessageText.text = "Scores Added: " + scoresAdded; }
private void AddScore(object sender, UserScoreArgs args) { DisplayTimes = LeaderboardController.TopScores; }