Google Play 游戏排行榜自定义
Google Play Games leaderboard custom
我想实现这个
"my ranking : Top 13% (25034 rank)"
我试过的↓
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 + "%";
});
我想实现这个 "my ranking : Top 13% (25034 rank)"
我试过的↓
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 + "%";
});