Get scores for a certain tier
Retrieve scores filtered by a specific tier.
Read time 1 minuteLast updated 8 months ago
Get the scores for a certain tier with the method. By default this method returns the top 10 scores from the specified tier:
GetScoresByTierAsyncpublic async void GetScoresByTier(string leaderboardId){ var scoresResponse = await LeaderboardsService.Instance .GetScoresByTierAsync(leaderboardId, "silver"); Debug.Log(JsonConvert.SerializeObject(scoresResponse));}
Paginated access to all scores within the tier is available by specifying the optional object with the optional and pagination arguments.
GetScoresByTierOptionsOffsetLimitOffsetLimitC#:
public async void GetPaginatedScoresByTier(string leaderboardId){ var scoresResponse = await LeaderboardsService.Instance.GetScoresByTierAsync( leaderboardId, "silver", new GetScoresByTierOptions{ Offset = 25, Limit = 50 } ); Debug.Log(JsonConvert.SerializeObject(scoresResponse));}
To get the score with any associated metadata, use the option on the configuration object:
IncludeMetadataGetScoresByTierOptionsC#:
public async void GetScoresByTierWithMetadata(string leaderboardId){ var scoresResponse = await LeaderboardsService.Instance .GetScoresByTierAsync( leaderboardId, "silver", new GetScoresByTierOptions { IncludeMetadata = true }); Debug.Log(JsonConvert.SerializeObject(scoresResponse));}