Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/101.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# Unity项目中的GameCenter_C#_Ios_Unity3d_Game Center - Fatal编程技术网

C# Unity项目中的GameCenter

C# Unity项目中的GameCenter,c#,ios,unity3d,game-center,C#,Ios,Unity3d,Game Center,我正试图在我的unity项目中实现GameCenter。到目前为止,我已经在itunes connect上制作了一个应用程序,并设置了游戏中心和排行榜 下面的函数在unity的UI按钮中调用 public void ShowLeaderBoardGameCenter() { Social.Active.ReportScore (1, "55379413", success => { Debug.Log(success ? "Reported score succes

我正试图在我的unity项目中实现GameCenter。到目前为止,我已经在itunes connect上制作了一个应用程序,并设置了游戏中心和排行榜

下面的函数在unity的UI按钮中调用

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

}
它的工作发现显示在排行榜上,但分数不显示

我还为gamecenter创建了一个沙箱帐户,我目前正在使用它

在我的unity项目中,它说“未找到排行榜”?-希望你们能帮忙

试试这个

    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
        }