【问题标题】:GameCenter in Unity projectUnity 项目中的 GameCenter
【发布时间】:2015-07-11 09:22:39
【问题描述】:

我正在尝试在我的统一项目中实现 GameCenter。到目前为止,我已经在 iTunes 中制作了一个应用程序连接并设置了游戏中心和排行榜。

下面的函数在一个 UI 按钮内统一调用。

public void ShowLeaderBoardGameCenter()
{
    Social.Active.ReportScore (1, "55379413", success => {
        Debug.Log(success ? "Reported score successfully" : "Failed to report score");
    });
    Social.Active.ShowLeaderboardUI ();

}

find 可以显示排行榜,但分数不显示。

我还为我目前使用的游戏中心创建了一个沙盒帐户。

在我的统一项目中,它显示“找不到排行榜”??? - 希望你们能帮忙。

【问题讨论】:

    标签: c# ios unity3d game-center


    【解决方案1】:

    试试这个,

        if (Social.localUser.authenticated) 
        {
            #if UNITY_ANDROID
            {
                ((PlayGamesPlatform)Social.Active).ShowLeaderboardUI (leaderboard); // Show current (Active) leaderboard
            }
            #elif UNITY_IOS
            {
                GameCenterPlatform.ShowLeaderboardUI ("BallzBrickSmasher_Leaderboard", TimeScope.AllTime);
            }
            #endif
            }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-07-24
      • 2019-12-31
      • 2015-01-17
      相关资源
      最近更新 更多