Google Play服务无法统一运行

时间:2019-07-19 12:00:07

标签: unity3d google-play-services

我正在尝试在我的游戏中实现Google Play服务,但这似乎不起作用。

我已经完成了指定的所有操作-将我的应用链接到开发者控制台中的服务。从应用程序->版本管理->应用程序签名->上传证书中添加了SHA1。从GitHub下载了最新的“播放服务”统一软件包。在统一编辑器的播放服务设置中添加了所需的“资源”。将以下脚本添加到“画布”对象:

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

 public class PlayGamesServices : MonoBehaviour
 {
     // Start is called before the first frame update
     void Start()
     {
         PlayGamesClientConfiguration clientConig = new 
         PlayGamesClientConfiguration.Builder().Build();
         PlayGamesPlatform.InitializeInstance(clientConig);
         PlayGamesPlatform.Activate();
         Social.localUser.Authenticate((bool success) =>
         {
             if (success)
                 Debug.Log("Logged In");
             else
                 Debug.Log("Failed to Log In");
         });
     }

     public static void PostToLederboard(long newHighScore)
     {

   Social.ReportScore(newHighScore,GPGSIds.leaderboard_global_high_score, (bool success) =>
         {
             if (success)
                 Debug.Log("New High Score posted");
             else
                 Debug.Log("Unable to post New High Score");
         });
     }

     public void ShowLeaderboard()
     {
    PlayGamesPlatform.Instance.ShowLeaderboardUI(GPGSIds.leaderboard_global_high_ score);
     }
 } 

我已经将我的游戏发布到了Alpha测试中,然后实现了播放服务。我想知道那是不是问题。

0 个答案:

没有答案
相关问题