ドキュメント

サポート

Get scores for a certain tier from a leaderboard version

Retrieve scores filtered by tier from a specified leaderboard version.
読み終わるまでの所要時間 1 分最終更新 3ヶ月前

This method fails when your leaderboard is not configured with tiers. When you retrieve scores by tier, the returned
LeaderboardEntry
response tiers are contextual to the rank. For example, if a rank named Silver starts at rank 100 and a player’s global rank is 101, their rank within the Silver tier is 1.
To get scores for a particular tier from a leaderboard version, use the
GetVersionScoresByTierAsync
method. By default this method returns the top 10 scores from the specified tier:
public async void GetVersionScoresByTier(string leaderboardId, string versionId){ var scoresResponse = await LeaderboardsService.Instance .GetVersionScoresByTierAsync(leaderboardId, versionId, "silver"); Debug.Log(JsonConvert.SerializeObject(scoresResponse));}
Paginated access to all scores within the tier is available by specifying the optional
GetVersionScoresByTierOptions
object with the optional
Offset
and
Limit
pagination arguments.
Offset
is the number of entries to skip when retrieving the leaderboard scores and defaults to 0.
Limit
is the number of leaderboard scores to return and defaults to 10.
public async void GetPaginatedVersionScoresByTier(string leaderboardId, string versionId){ var scoresResponse = await LeaderboardsService.Instance.GetVersionScoresByTierAsync( leaderboardId, versionId, "silver", new GetVersionScoresByTierOptions{ Offset = 25, Limit = 50 } ); Debug.Log(JsonConvert.SerializeObject(scoresResponse));}
Metadata is not retrieved by default.
To get the score with any associated metadata, use the
IncludeMetadata
option on the
GetVersionScoresByTierOptions
configuration object:
public async void GetVersionScoresByTierWithMetadata(string leaderboardId, string versionId){ var scoresResponse = await LeaderboardsService.Instance.GetVersionScoresByTierAsync( leaderboardId, versionId, "silver", new GetVersionScoresByTierOptions { IncludeMetadata = true } ); Debug.Log(JsonConvert.SerializeObject(scoresResponse));}
For details on how to get available leaderboard version IDs, visit Get available leaderboard version.
For methods that retrieve scores: if your player has not submitted a score and the leaderboard is bucketed, the player is not assigned a bucket. A failed score retrieval returns an error that has its
Reason
field set to
ScoreSubmissionRequired
.