2
用户身份验证不适用于我为Android制作的应用程序。这是附加到我的主菜单中的空游戏对象的脚本。用户无法登录谷歌播放服务
void Start()
{
PlayGamesPlatform.Activate();
PlayGamesPlatform.DebugLogEnabled = true;
}
public void LoadScene(string sceneName)
{
SceneManager.LoadScene(sceneName);
}
public void showleaderboard()
{
if(Social.localUser.authenticated)
{
PlayGamesPlatform.Instance.ShowLeaderboardUI("CgkIq82p4qcNEAIQAQ");
}
else
{
Debug.Log("leaderboard not working");
}
}
public void userlogin()
{
Social.localUser.Authenticate((bool success) =>
{
if(success)
{
Debug.Log("Logged in");
}
else
{
Debug.Log("Login failed");
}
});
}
该功能被附加到按钮,我总是在我的控制台中得到日志“登录失败”。我在一台能够在其他已发布的应用程序中登录Google Play服务的Android设备上测试了此功能。