ドキュメント

サポート

Get the player's score

Retrieve the current player's score from a leaderboard.
読み終わるまでの所要時間 1 分最終更新 3ヶ月前

Get the entry for the player in the specified leaderboard with the
GetPlayerScoreAsync
method:
public async void GetPlayerScore(string leaderboardId){ var scoreResponse = await LeaderboardsService.Instance .GetPlayerScoreAsync(leaderboardId); Debug.Log(JsonConvert.SerializeObject(scoreResponse));}
Metadata is not retrieved by default.
To get the score with any associated metadata, use the
IncludeMetadata
option on the
GetPlayerScoreOptions
configuration object:
public async void GetPlayerScore(string leaderboardId){ var scoreResponse = await LeaderboardsService.Instance .GetPlayerScoreAsync( leaderboardId, new GetPlayerScoreOptions { IncludeMetadata = true } ); Debug.Log(JsonConvert.SerializeObject(scoreResponse));}
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
.