Get scores from a leaderboard version
Retrieve a list of scores from a specific leaderboard.
Read time 1 minuteLast updated 21 days ago
Players can get scores from a specified leaderboard version with the
GetVersionScoresAsyncPaginated access to all scores in the leaderboard is available by specifying the optionalpublic async void GetVersionScores(string leaderboardId, string versionId){ var scoresResponse = await LeaderboardsService.Instance .GetVersionScoresAsync(leaderboardId, versionId); Debug.Log(JsonConvert.SerializeObject(scoresResponse));}
GetVersionScoresOptionsOffsetLimitOffsetLimitpublic async void GetPaginatedVersionScores(string leaderboardId, string versionId){ var scoresResponse = await LeaderboardsService.Instance.GetVersionScoresAsync( leaderboardId, versionId, new GetVersionScoresOptions{ Offset = 25, Limit = 50 } ); Debug.Log(JsonConvert.SerializeObject(scoresResponse));}
To get the score with any associated metadata, use the
IncludeMetadataGetVersionScoresOptionsFor details on how to get available leaderboard version IDs, see Get available leaderboard version.public async void GetVersionScoresWithMetadata(string leaderboardId, string versionId){ var scoresResponse = await LeaderboardsService.Instance.GetVersionScoresAsync( leaderboardId, versionId, new GetVersionScoresOptions { IncludeMetadata = true } ); Debug.Log(JsonConvert.SerializeObject(scoresResponse));}