ドキュメント

サポート

Get scores for other players from a leaderboard version

Retrieve scores for other players from a specific leaderboard version.
読み終わるまでの所要時間 1 分最終更新 3ヶ月前

Get the scores for other players from a leaderboard version with the
GetVersionScoresByPlayerIdsAsync
method:
public async void GetVersionScoresByPlayerIds(string leaderboardId, string versionId){ var playerIds = new List<string>{ "abc123", "abc456" }; var scoresResponse = await LeaderboardsService.Instance .GetVersionScoresByPlayerIdsAsync( leaderboardId, versionId, playerIds ); 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
GetVersionScoresByPlayerIdsOptions
configuration object:
public async void GetVersionScoresByPlayerIdsWithMetadata(string leaderboardId, string versionId){ var playerIds = new List<string>{ "abc123", "abc456" }; var scoreResponse = await LeaderboardsService.Instance .GetVersionScoresByPlayerIdsAsync( leaderboardId, versionId, playerIds, new GetVersionScoresByPlayerIdsOptions { IncludeMetadata = true } ); Debug.Log(JsonConvert.SerializeObject(scoreResponse));}
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
.