Android ShowleaderboardsUI();不起作用
我一直在努力将我的应用程序与google play服务连接起来,我的用户在连接应用程序时遇到了一个问题,但在这之后,我制作了一个带有“ShowleaderboardsUI();”的按钮,单击后什么也没有发生。我已将电子邮件添加到测试组Android ShowleaderboardsUI();不起作用,android,unity3d,google-play,google-play-services,google-play-games,Android,Unity3d,Google Play,Google Play Services,Google Play Games,我一直在努力将我的应用程序与google play服务连接起来,我的用户在连接应用程序时遇到了一个问题,但在这之后,我制作了一个带有“ShowleaderboardsUI();”的按钮,单击后什么也没有发生。我已将电子邮件添加到测试组 using UnityEngine; using UnityEngine.UI; using GooglePlayGames; using UnityEngine.SocialPlatforms; public class AchievmentManager :
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.xml中创建自定义mainfest