我正在創建一個統一的2D遊戲,並且遇到了問題。我已經創建了一個谷歌播放開發者帳戶,併發布我的遊戲谷歌播放封閉的阿爾法。我現在將Google Play遊戲服務添加到遊戲中,並且我從最新的圖書館(https://github.com/playgameservices/play-games-plugin-for-unity)下載並將其導入Unity。我已經設置了一切,但嘗試登錄時遊戲崩潰。登錄Google Play遊戲服務後遊戲崩潰
using UnityEngine;
using GooglePlayGames;
using GooglePlayGames.BasicApi;
using UnityEngine.SocialPlatforms;
using System.Collections;
public class gpgTest : MonoBehaviour {
void Start() {
PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder()
// enables saving game progress.
.EnableSavedGames()
// require access to a player's Google+ social graph (usually not needed)
.RequireGooglePlus()
.Build();
PlayGamesPlatform.InitializeInstance(config);
// recommended for debugging:
PlayGamesPlatform.DebugLogEnabled = true;
// Activate the Google Play Games platform
PlayGamesPlatform.Activate();
}
void Update() {
}
public void LogIn()
{
Debug.Log("button");
// authenticate user:
Social.localUser.Authenticate((bool success) => {
// handle success or failure
});
}
}
注:我已經試過了圖書館幾乎所有版本,不同版本的統一5.0及以上。
而且我也安裝所有necesary包在SDK管理器。