我想实现这个“我的排名:前13%(25034排名)”
我试过的↓
Social.LoadScores("CgkI1...", scores => {...})
:“scores.Length”最多只返回25。
ILeaderboard lb = Social.CreateLeaderboard();
lb.id = "CgkI1...";
uint max_player = lb.maxRange;
:失败..
我不知道排行榜球员数和我的排名。请帮帮我,我该怎么办..
我自己成功了:
ILeaderboard lb = PlayGamesPlatform.Instance.CreateLeaderboard();
lb.id = "CgkI1...";
lb.userScope = UserScope.Global;
lb.range = new Range(1,10);
lb.timeScope = TimeScope.AllTime;
lb.LoadScores(scores =>
{
uint all_player = lb.maxRange;
int my_rank = lb.localUserScore.rank;
decimal percent = (decimal)my_rank / (decimal)all_player;
text.text = scores.ToString() + "\nAllPlayer: " + all_player + "\nMyRank: " + my_rank + "\nMyScore: " +lb.localUserScore.value.ToString() + "\nPercent: " + percent + "%";
});