文档

支持

Get the player's score from a leaderboard version

Retrieve the current player's score from an archived leaderboard.
阅读时间1 分钟最后更新于 1 个月前

Players can get their entry in the specified leaderboard archive version with the
GetVersionPlayerScoreAsync
method:
public async void GetPlayerVersionScore(string leaderboardId, string versionId){ var scoreResponse = await LeaderboardsService.Instance .GetVersionPlayerScoreAsync(leaderboardId, versionId); Debug.Log(JsonConvert.SerializeObject(scoreResponse));}
To get the score with any associated metadata, use the
IncludeMetadata
option on the
GetVersionPlayerScoreOptions
configuration object:
public async void GetPlayerVersionScoreWithMetadata(string leaderboardId, string versionId){ var scoreResponse = await LeaderboardsService.Instance .GetVersionPlayerScoreAsync( leaderboardId, versionId, new GetVersionPlayerScoreOptions { IncludeMetadata = true } ); Debug.Log(JsonConvert.SerializeObject(scoreResponse));}
For details on how to get available leaderboard version IDs, visit Get available leaderboard version.