显示排行榜UI();不工作

ShowleaderboardsUI(); not working

我一直在努力将我的应用程序与 google 播放服务连接起来,我的用户连接到该应用程序时遇到问题,但在那之后我用 [=13 创建了一个按钮=] 并且在点击之后没有任何反应。我已将我的电子邮件添加到测试组。

using UnityEngine;
using UnityEngine.UI;
using GooglePlayGames;
using UnityEngine.SocialPlatforms;

public class AchievmentManager : MonoBehaviour
{

    private bool IsConnectedToGoogleServices;

   void Start()
    {
        PlayGamesPlatform.DebugLogEnabled = true;
        PlayGamesPlatform.Activate();
        IsConnectedToGoogleServices = false;
        ConnectToGoogleServices();
    }

 public bool ConnectToGoogleServices()
    {
        if (!IsConnectedToGoogleServices)
        {
            {
                Social.localUser.Authenticate((bool success) =>
                    {
                        IsConnectedToGoogleServices = success;
                    });
            }
        }
        return IsConnectedToGoogleServices;
    }

    public void ToLeaderboard()
    {
        if (Social.localUser.authenticated)
        {
            Social.ShowLeaderboardUI();
        }
        else
        {
            Debug.Log("Unable to connect google play services");
        }
    }
}

您应该尝试将此添加到您的 android mainfest:

 <activity android:name="com.google.games.bridge.NativeBridgeActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />

您可以在 Assets/Plugins/Android/AndroidMainfest 中创建自定义 mainfest。xml