Unity 2018.2版本接入Google Play Game Service

开发环境
  • Unity 2018.2.13f
  • Android Studio 3.2.1
  • Android 8.1(API Level 27)
  • SDK Build-Tools 28.0.3
  • JRE 1.8.0_152
  • GooglePlayGamesPlugin-0.9.51

接入

参考官方文档 https://github.com/playgameservices/play-games-plugin-for-unity

注意

  • GooglePlayGamesPlugin-0.9.51在Unity 2018.2版本中打包出来的安卓包是会闪退的,需要打开项目目录下的template-AndroidManifest.txt,将 "\ APP_ID" 更改成 "\u003__APP_ID__",然后执行Window/Google Play Services/Setup
  • 如果接入后不闪退但是Google Play Game登陆不成功,可能是因为:
1)没有完成OAuth认证设置:
1.Google Play Console -> Select your app -> Release Management -> App signing -> "Upload certificate" copy SHA-1 (dont copy word 'SHA1:')
2. open https://console.developers.google.com/ , select your project -> credentials -> OAuth 2.0 client IDs -> Edit OAuth client -> Signing-certificate fingerprint -> replace the old SHA1 with copied SHA1 ->save.
3. open you game, you should get sign in -> email selection -> select testers email. Google Play Games Services should work fine now."

2).没有设置测试账号
Unity 2018.2版本接入Google Play Game Service_第1张图片
11540716964_.pic_hd.jpg

参考:
https://answers.unity.com/questions/1357666/google-play-games-services-authentication-fails.html
https://github.com/playgameservices/play-games-plugin-for-unity/issues/2013

你可能感兴趣的:(Unity 2018.2版本接入Google Play Game Service)