# 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._
## 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:<br/>
* 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
System requirements:
* Unity® 2017.4 or above.
* To deploy on Android:
* Android SDK
* Android v4.0 or higher
* Google Play Services library, version 11.6 or above
## 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).
## Configure Your Game
To use the plugin, you must first [configure your
game](https://developers.google.com/games/services/console/enabling) in the
Google Play Developer Console. Follow the instructions on creating a client ID.
Be particularly careful when entering your package name and your
certificate fingerprints, since mistakes on those screens can be difficult to
recover from.
### Copy the game resources from the console
Once you configure at least one resource (event, achievement, or leaderboard),
copy the resource configuration from the Google Play Developer Console, and paste it
into the setup configuration in Unity. To get the resources go to the Achievements
tab, then click on "Get resources" on the bottom of the list.
![click Get Resources](source/docgen/resourcesLink.png "Show the resources data")
Then click the "Android section".
![Android Resources](source/docgen/resources.png "Android resource data")
Select all the contents of the resources window, and copy them to the clipboard.
### Paste the game resources into the plugin setup dialog
Back in Unity, open the setup dialog **Window > Google Play Games > Setup... > Android Setup**
![Android Setup](source/docgen/AndroidSetup.png "Android setup")
* **Enter the directory to save constants** - Enter the folder for the constants file.
* **Constants class name** - this is the name of the C# class to create, including namespace.
* **Resources Definition** - paste the resource data from the Play Games console here.
* **Web client ID** - this is the client ID of the linked web app. It is only needed if
you have a web-based backend for your game and need a server auth code to be
exchanged for an access token by the backend server, or if you need an id token
for the player to make other, non-game, API calls.
The setup process will configure your game with the client id and generate a
C# class that contains constants for each of your resources.
## Setup Checklist
Make sure to do the following if they are relevant to your game:
1. Add tester email addresses to the testing section of your game on the Play Games Console.
2. The SHA1 fingerprint used to create the linked Android app is from the keystore
used to sign the Unity application.
## Add Achievements and Leaderboards
Add
[achievements](https://developers.google.com/games/services/common/concepts/achievements)
and
[leaderboards](https://developers.google.com/games/services/common/concepts/leaderboards)
to your game in the Google Play Developer Console. For each achievement and
leaderboard you configure, make sure to note
the corresponding **achievement ID** or **leaderboard ID**,
as those will be needed when making the API calls.
Achievement and leaderboard IDs are alphanumeric strings (e.g. "Cgkx9eiuwi8_AQ").
## Add Events
Events allow you to track user actions in your game and report on them with
Analytics.
Read more about how to configure and use Events on
[Game Concepts - Events](https://developers.google.com/games/services/common/concepts/events)
## Load Your Game Project
Next, load your game project into the Unity editor.
If you do not have a game project to work with, you can use the **Minimal** sample
available in the **samples** directory. Using that sample will allow you to
quickly test your setup and make sure you can access the API.
If you want to test a larger sample after you are familiar with the plugin,
try the **CubicPilot** game.
More information about building the samples can be found in the
[samples README](samples/README.md) file.
## Plugin Installation
To download the plugin, clone this Git repository into your file system (or download it as
a ZIP file and unpack it). Then, look for the **unitypackage** file in
the **current-build** directory:
current-build/GooglePlayGamesPluginForUnity-X.YY.ZZ.unitypackage
To install the plugin, simply open your game project in Unity and import that file into
your project's assets, as you would any other Unity package. This is accomplished through
the **Assets > Import Package > Custom Package** menu item (you can also reach this menu it
by right-clicking the **Assets** folder).
Next, make sure your current build platform is set to **Android**. From
**File > Build Settings…** select **Android** and click **Switch Platform**.
You should now see a new menu item was added under **Window > Google Play Games**.
If you don't see the new menu items, refresh the assets by
clicking **Assets > Refresh** and try again.
## Android Setup
Next, set up the path to your Android SDK installation in Unity. This is located in the
preferences menu, under the **External Tools** section.
To configure your Unity game to run with Google Play Games on Android, first
open the Android SDK manager and verify that you have downloaded the following
packages. Depending on if you are using the SDK manager from Android Studio,
or using the standalone SDK manager, the name of the components may be different.
- Google Play Services
- Android Support Library
- Local Maven repository for Support Libraries (Also known as Android Support Repository)
- Google Repository
- Android 6.0 (API 23) (this does not affect the min SDK version).
Next, configure your game's package name. To do this, click **File > Build Settings**,
select the **Android** platform and click **Player Settings** to show Unity's
Player Settings window. In that window, look for the **Bundle Identifier** setting
under **Other Settings**. Enter your package name there (for example
_com.example.my.awesome.game_).
In order to sign in to Play Game Services, you need to sign your APK file,
make sure that you are signing it with the
correct certificate, that is, the one that corresponds to the SHA1 certificate
fingerprint you entered in the Developer Console during the setup.
Next, click the **Window |Google Play Games|Setup - Android setup** menu item.
This will display the Android setup screen.
Enter the Constants class name. This is the name of the fully qualified class
that will be updated (or created) which contains the IDs of the game resource
没有合适的资源?快使用搜索试试~ 我知道了~
play-games-plugin-for-unity-0.11.01.zip
共217个文件
meta:85个
cs:64个
java:15个
1星 需积分: 3 1 下载量 46 浏览量
2022-11-07
14:44:50
上传
评论
收藏 1.24MB ZIP 举报
温馨提示
play-games-plugin-for-unity-0.11.01.zip Google登录接入 Unity接入谷歌SDK登录
资源推荐
资源详情
资源评论
收起资源包目录
play-games-plugin-for-unity-0.11.01.zip (217个子文件)
Google.Play.Games.Editor.asmdef 148B
Google.Play.Games.asmdef 105B
ProjectSettings.asset 39KB
NavMeshLayers.asset 9KB
TagManager.asset 5KB
InputManager.asset 5KB
QualitySettings.asset 4KB
DynamicsManager.asset 4KB
Physics2DSettings.asset 4KB
EditorSettings.asset 4KB
EditorBuildSettings.asset 4KB
AudioManager.asset 4KB
NetworkManager.asset 4KB
TimeManager.asset 4KB
gradlew.bat 3KB
gradlew.bat 3KB
gradlew.bat 3KB
bridge.cc 735B
plugin_shim.cc 728B
PlayGamesPlatform.cs 55KB
AndroidClient.cs 43KB
GPGSUtil.cs 29KB
MainGui.cs 25KB
AndroidSavedGameClient.cs 24KB
ISavedGameClient.cs 21KB
NearbyGUI.cs 19KB
AndroidNearbyConnectionClient.cs 18KB
IPlayGamesClient.cs 17KB
GPGSAndroidSetupUI.cs 16KB
GPGSStrings.cs 10KB
PlayerStats.cs 9KB
AndroidHelperFragment.cs 9KB
PlayGamesAchievement.cs 9KB
LeaderboardGUI.cs 8KB
DummyClient.cs 8KB
CommonTypes.cs 7KB
PlayGamesHelperObject.cs 7KB
AchievementGUI.cs 6KB
PlayGamesLocalUser.cs 6KB
PlayGamesUserProfile.cs 6KB
Achievement.cs 6KB
AndroidJavaConverter.cs 6KB
AndroidEventsClient.cs 6KB
GPGSProjectSettings.cs 5KB
NearbyConnectionUI.cs 5KB
FriendsGUI.cs 5KB
PlayGamesLeaderboard.cs 5KB
DummyNearbyConnectionClient.cs 4KB
SavedGameMetadataUpdate.cs 4KB
CommonStatusCodes.cs 4KB
ConnectionResponse.cs 4KB
ISavedGameMetadata.cs 3KB
LeaderboardScoreData.cs 3KB
PlayGamesScore.cs 3KB
AndroidTaskUtils.cs 3KB
GameInfo.cs 3KB
Logger.cs 3KB
NearbyHelperObject.cs 3KB
Misc.cs 3KB
IEventsClient.cs 3KB
INearbyConnectionClient.cs 3KB
AndroidSnapshotMetadata.cs 2KB
ScorePageToken.cs 2KB
GPGSDocsUI.cs 2KB
GPGSUpgrader.cs 2KB
PlatformUtils.cs 2KB
GPGSIds.cs 2KB
IEvent.cs 2KB
NearbyConnectionConfiguration.cs 2KB
PlayGamesClientFactory.cs 2KB
AdvertisingResult.cs 1KB
EndpointDetails.cs 1KB
GPGSPostBuild.cs 1KB
ConnectionRequest.cs 1KB
NearbyConnectionClientFactory.cs 1KB
Player.cs 1KB
SignInInteractivity.cs 1KB
Event.cs 1KB
PlayerProfile.cs 1KB
PluginVersion.cs 952B
AssemblyInfo.cs 832B
AssemblyInfo.cs 816B
SignInStatus.cs 317B
build.gradle 25KB
build.gradle 2KB
build.gradle 419B
settings.gradle 34B
gradlew 6KB
gradlew 6KB
gradlew 6KB
MyGUISkin.guiskin 31KB
bridge.h 5KB
gradle-wrapper.jar 58KB
gradle-wrapper.jar 58KB
gradle-wrapper.jar 58KB
HelperFragment.java 8KB
NativeBridgeActivity.java 6KB
SelectSnapshotUiRequest.java 4KB
SimpleUiRequest.java 2KB
GenericResolutionUiRequest.java 2KB
共 217 条
- 1
- 2
- 3
资源评论
- 醉落尘阳光2022-11-17人家免费的东西 你收费 #毫无价值
HandleSolver
- 粉丝: 13
- 资源: 55
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功