找到你要的答案

Q:GooglePlayGames loading logo pops up everytime I start my app

Q:googleplaygames加载标识弹出每次我启动我的应用

So I want to implement GooglePlayGames services into my Unity3D game but everytime I open my game from my android device it pops up the google play games loading logo and this happens everytime. I also can not open the leaderboard and achievements UI. I have set up everything in the developer console and my project. I have added my email as a tester. Here is my code:

This is a script attached to my camera

using UnityEngine;
using System.Collections;
using GooglePlayGames;
using UnityEngine.SocialPlatforms;


public class GooglePlayGamesScript : MonoBehaviour {

// Use this for initialization
void Awake () {
    PlayGamesPlatform.DebugLogEnabled = true;
    PlayGamesPlatform.Activate();

}

// Update is called once per frame
void Start () {
    if(!Social.localUser.authenticated){
    Social.localUser.Authenticate((bool success) => {
        Debug.Log("Authenticating");
        });
    }
}

}

and here I try to report score:

Social.ReportScore(AddPoints.HighScore,"770479155009",
(bool success) => {
Debug.Log("reporting score");
});

If anyone has any idea what can be causing this, please let me know. Also I should mention that my game isn't published.

所以我想在我的Unity3D游戏实现googleplaygames服务,但每次我打开我的游戏我的Android设备弹出谷歌玩游戏加载标识,这种情况每次。我也无法打开排行榜和成就的UI。我已经在开发者控制台和我的项目中设置了一切。我已经添加了我的电子邮件作为测试。这是我的代码:

这是附在我相机上的脚本

using UnityEngine;
using System.Collections;
using GooglePlayGames;
using UnityEngine.SocialPlatforms;


public class GooglePlayGamesScript : MonoBehaviour {

// Use this for initialization
void Awake () {
    PlayGamesPlatform.DebugLogEnabled = true;
    PlayGamesPlatform.Activate();

}

// Update is called once per frame
void Start () {
    if(!Social.localUser.authenticated){
    Social.localUser.Authenticate((bool success) => {
        Debug.Log("Authenticating");
        });
    }
}

}

在这里我尝试报告分数:

Social.ReportScore(AddPoints.HighScore,"770479155009",
(bool success) => {
Debug.Log("reporting score");
});

If anyone has any idea what can be causing this, please let me know. Also I should mention that my game isn't published.

answer1: 回答1:

This is happening because your user is never getting authenticated. Could happen for a few reasons. Here's a couple I myself have faced earlier.

  1. Trying to run GPG in an unpublished app. This has been the cause of my problems a few times. Upload a build in the Alpha Channel, and ensure that the ID you're using is part of the list of approved testers. Also, don't forget to publish the game in GPG as well.

  2. If you're running any apps that interfere with Play Services, stop them. One that gave me a ton of grief was Freedom. Generally, just stop anything that possibly uses SU

这是因为你的用户从来没有得到认证。可能发生的原因有几个。这是我自己早些时候面对的一对夫妇。

  1. 试图在一个公开的应用程序运行的GPG。这是我的问题的原因几次。在alpha通道上载一个版本,并确保您使用的ID是被批准的测试人员列表的一部分。还有,别忘了发布游戏的GPG为好。

  2. 如果你运行的任何应用程序干扰游戏服务,停止他们。给我一吨悲伤的是自由。一般来说,停止任何可能使用SU

c#  unity3d  google-play  google-play-games