百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
P

play-games-plugin-for-unity

> 编程语言
开源

适用于 Unity 的 Google Play Games 插件

3.6K stars0 点赞0 次浏览
访问官网GitHub

工具介绍

适用于 Unity 的 Google Play Games 插件

# Google Play Games plugin for Unity _Copyright (c) 2014 Google Inc. All rights reserved._ The Google Play Games plugin for Unity® is an open-source project whose goal is to provide a plugin that allows game developers to integrate with the Google Play Games API from a game written in Unity®. However, this project is not in any way endorsed or supervised by Unity Technologies. _Unity® is a trademark of Unity Technologies._ _iOS is a trademark of Apple, Inc._ ## Downloads Please download the package from the [Github release page](https://github.com/playgameservices/play-games-plugin-for-unity/releases). ## Overview The Google Play Games plugin for Unity allows you to access the Google Play Games API through Unity's [social interface](http://docs.unity3d.com/Documentation/ScriptReference/Social.html). The plugin provides support for the following features of the Google Play Games API:
* sign in * friends * unlock/reveal/increment achievement * post score to leaderboard * cloud save read/write * show built-in achievement/leaderboards UI * events * [nearby connections](NEARBY.md) __NOTICE__: This version of the plugin no longer supports iOS. Google Play games services for iOS is deprecated, and is not likely to function as expected. Do not use Google Play games services for iOS in new apps. See the [deprecation announcement](https://android-developers.googleblog.com/2017/04/focusing-our-google-play-games-services.html) blog post for more details. Features: * easy GUI-oriented project setup (integrated into the Unity GUI) * no need to override/customize the player Activity * no need to override/customize AndroidManifest.xml ## Documentation For instructions on using the plugin, please refer to [this developer guide](https://developer.android.com/games/pgs/unity/unity-start). For a sample application demonstrating how to use Google Play Games see [SmokeTest](https://github.com/playgameservices/play-games-plugin-for-unity/tree/master/Samples/SmokeTest) project; ## Upgrading If you have already integrated your project with a previous version of the plugin and wish to upgrade to a new version, please refer to the [upgrade instructions](UPGRADING.txt). ## Decreasing apk size It is possible to decrease the size of the Play Games Services Unity Plugin by removing code for the Play Games Services features that your game doesn’t use by using Proguard. Proguard will remove the Play Games Unity plugin code for features that are not used in your game, so your game ships with only the code that is needed and minimizes the size impact of using Play Games Services. Additionally, it is possible to reduce the size of the entire Unity project using Unity’s [Managed Code Stripping](https://docs.unity3d.com/Manual/ManagedCodeStripping.html), which will compress your entire project. This can be used in conjunction with Proguard. ### Play Games Services Proguard configuration 1. Go to `File > Build Settings > Player Settings` and click `Publishing Settings` section. Choose `Proguard` for `Minify > Release`. Then, enable `User Proguard File`. If you want the plugin to be proguarded for debug apks as well, you can choose `Proguard` for `Minify > Debug`. 2. Copy the content of [the proguard configuration](scripts/proguard.txt) into `Assets/Plugins/Android/proguard-user.txt`. ## (Advanced) Using the Plugin Without Overriding the Default Social Platform When you call `PlayGamesPlatform.Activate`, Google Play Games becomes your default social platform implementation, which means that static calls to methods in `Social` and `Social.Active` will be carried out by the Google Play Games plugin. This is the desired behavior for most games using the plugin. However, if for some reason you wish to keep the default implementation accessible (for example, to use it to submit achievements and leaderboards to a different social platform), you can use the Google Play Games plugin without overriding the default one. To do this: 1. Do not call `PlayGamesPlatform.Activate` 2. If `Xyz` is the name of a method you wish to call on the `Social` class, do not call `Social.Xyz`. Instead, call `PlayGamesPlatform.Instance.Xyz` 3. Do not use `Social.Active` when interacting with Google Play Games. Instead, use `PlayGamesPlatform.Instance`. That way, you can even submit scores and achievements simultaneously to two or more social platforms: ```csharp // Submit achievement to original default social platform Social.ReportProgress("MyAchievementIdHere", 100.0f, callback); // Submit achievement to Google Play PlayGamesPlatform.Instance.ReportProgress("MyGooglePlayAchievementIdHere", 100.0f, callback); ``` ## Special Thanks This section lists people who have contributed to this project by writing code, improving documentation or fixing bugs. * [Dgizusse](https://github.com/Dgizusse) for figuring out that setting JAVA_HOME is necessary on Windows. * [antonlicht](https://github.com/antonlicht) for fixing a bug with the parameter type of showErrorDialog on the support library. * [pR0Ps](https://github.com/pR0Ps) for fixing an issue where OnAchievementsLoaded was not accepting an OPERATION_DEFERRED result code as a success. * [friikyeu](https://github.com/friikyeu) for helping debug [an issue](https://github.com/playgameservices/play-games-plugin-for-unity/issues/25) that caused API calls to be queued up rather than executed even when connected.

GitHub Issues· 182 开放

在 GitHub 查看全部
  • #3393

    Fatal Exception: java.lang.UnsatisfiedLinkError dlopen failed: library "libgpg.so" not found

    更新于 2026年9月14日
  • #3392

    Error: Max XP must be more than min XP!

    bug更新于 2026年9月7日
  • #3345

    Play Games Configuration Keeps Resetting

    bug更新于 2026年9月5日
  • #3379

    Saved Games Permanently Stuck After Offline Play

    bug更新于 2026年8月2日
  • #3390

    [Feature request] Supported way to suppress automatic sign-in at launch (e.g. `SUPPRESS_AUTOMATIC_SIGN_IN` meta-data), analogous to `SUPPRESS_GAME_PROFILE_CREATION`

    更新于 2026年7月24日
  • #3336

    UnityEngine.SocialPlatforms is obsolete

    更新于 2026年7月8日
  • #3387

    PlayGamesScore.cs possible typo issue with leaderboardID

    bug更新于 2026年6月30日
  • #3385

    Sidekick not displaying despite all Google Play Games Services configuration being published

    更新于 2026年6月19日
  • #3378

    Achievements and leaderboards are not available in the build.

    bug更新于 2026年6月9日
  • #3136

    Sign in not working, please help

    更新于 2026年5月29日

核心特点

  • •unlock/reveal/increment achievement
  • •post score to leaderboard
  • •cloud save read/write
  • •show built-in achievement/leaderboards UI
  • •nearby connections
  • •easy GUI-oriented project setup (integrated into the Unity GUI)
  • •no need to override/customize the player Activity
  • •no need to override/customize AndroidManifest.xml
  • •Dgizusse for figuring out that setting JAVA_HOME is necessary on Windows.
  • •antonlicht for fixing a bug with the parameter type of showErrorDialog on the support library.

> 标签

C#

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言