我想要显示排行榜得分直接作为球员按排行榜图标,如下所示:

当我显示排行榜时,它只显示排行榜列表。我想直接看到实际得分。

下面是我的代码:
public void ShowLeaderboard ()
{
if (Social.localUser.authenticated)
Social.ShowLeaderboardUI ();
else {
// authenticate user:
Social.localUser.Authenticate ((bool success) => {
// handle success or failure
if (success) {
Debug.Log ("Login Success....");
PostHighScoreOnLeaderBoard();
Social.ShowLeaderboardUI ();
} else {
Debug.Log ("Login Failed....");
}
});
}
}怎样才能直接显示球员的得分?
发布于 2017-08-01 01:55:12
如果您希望像在第一张图像中那样直接显示用户的分数,则需要使用传入的排行榜ID而不是Social.ShowLeaderboardUI()来调用PlayGamesPlatform.Instance.ShowLeaderboardUI("leaderboard_id")。
发布于 2018-06-03 04:33:56
如果你想显示一个特定的排行榜而不是所有的排行榜,你可以将一个排行榜ID传递给这个方法。但是,这是一个Play Game扩展,因此需要首先将Social.Active对象转换为PlayGamesPlatform对象:
using GooglePlayGames;
using UnityEngine.SocialPlatforms;
...
// show leaderboard UI
PlayGamesPlatform.Instance.ShowLeaderboardUI("Cfji293fjsie_QA");https://stackoverflow.com/questions/45387516
复制相似问题