我想实现这个 “我的排名:排名前13%(排名25034)”
我尝试过的内容↓
Social.LoadScores("CgkI1...", scores => {...})
:“ scores.Length”仅返回最多25个。
ILeaderboard lb = Social.CreateLeaderboard();
lb.id = "CgkI1...";
uint max_player = lb.maxRange;
:失败。.
我不知道排行榜的玩家人数和排名。 请帮我该怎么办..
答案 0 :(得分:0)
我自己成功了:
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 + "%";
});