Unity 2018.2 Google Play游戏服务无法正常工作

时间:2018-10-19 12:43:43

标签: c# android unity3d google-play-services

我尝试了其他操作,例如添加\ u003 奇怪的是,每当我使用Unity 2017.4.1f1时,Google Play游戏服务都能按预期工作。但是每当我在Unity 2018上尝试它时,它甚至都不会运行,当我在android上使用它时,它甚至都不会更改调试。 (但是在编辑器中,单击“登录”时,它将显示loginfailed) The debug image

这是我的代码:

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

using UnityEngine.UI;

public class GPGSManager : MonoBehaviour {

    public Text debugTxt;
    private void Start()
    {

        PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder()
            // enables saving game progress.
            .EnableSavedGames()
            .RequestEmail()
            .RequestServerAuthCode(false)
            .RequestIdToken()
            .Build();


        PlayGamesPlatform.DebugLogEnabled = true;
        // Activate the Google Play Games platform
        PlayGamesPlatform.InitializeInstance(config);
        // recommended for debugging:

        PlayGamesPlatform.Activate();

        Social.localUser.Authenticate((bool success) => {
            if (success)
            {
                debugTxt.text = "LogIn Success";
            }
            else
            {
                debugTxt.text = "LogIn Failed";
            }
        });

    }

    public void SignIn()
    {
        Social.localUser.Authenticate((bool success) => {
            if (success)
            {
                debugTxt.text = "LogIn Success";
            }
            else
            {
                debugTxt.text = "LogIn Failed";
            }
        });
    }

    public void ShowAchievements()
    {
        Social.ShowAchievementsUI();
    }

    public void ShowLeaderboards()
    {
        Social.ShowLeaderboardUI();
    }
}

我使用Play游戏服务插件实现统一(v0.9.5) 任何帮助将不胜感激!

0 个答案:

没有答案