Google Play 游戏服务使用入门
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
本页概述了如何设置 Google Play 游戏服务,以及如何为 Android 游戏添加功能。这些任务包括在 Google Play 管理中心内设置服务,以及为游戏添加功能(例如登录和成就)。
如需直接查看每种编程语言对应的指南,请点击以下链接:
C 和 CPP
Unity
Java
Play 游戏服务设置任务通常适用于 C 游戏和 Java 游戏。但是,设置游戏项目和添加 Play 游戏服务功能的任务特定于游戏项目中使用的主要编程语言。Unity 游戏的入门任务之间还有其他区别,因为它们使用 Play 游戏服务的插件,而不是一组额外的 C# API。
为游戏设置 Play 游戏服务并添加功能的基本步骤如下:
设置 Play 游戏服务。
设置游戏项目并集成登录服务。
设置游戏项目并为其添加功能。
测试并发布您对 Play 游戏服务功能所做的任何更改。
前期准备
您必须在 Play 管理中心内设置 Google Play 开发者账号。如需了解详情,请参阅注册 Google Play 开发者账号。
设置 Play 游戏服务
设置游戏项目
您必须先在游戏项目中设置 Play 游戏服务并集成登录服务,然后才能添加其他 Play 游戏服务功能。如需了解详情,请参阅以下指南。这些任务特定于游戏项目使用的主要编程语言:
添加其他功能
集成登录服务后,您可以为游戏添加其他 Play 游戏服务功能。这需要在 Play 管理中心内设置功能,然后在游戏项目中集成 API。
如需了解详情,请参阅以下指南:
测试和发布 Play 游戏服务更新
为游戏项目添加 Play 游戏服务功能后,您应使用在配置 Play 游戏服务时设置的测试账号测试对 Play 游戏服务项目进行的任何更新。对更改感到满意后,您便可以使用 Play 管理中心发布更改。这不涉及发布游戏,只会更新由 Google 托管的 Play 游戏服务项目和服务。
后续操作
设置 Play 游戏服务并为游戏添加功能后,您可以使用 Play 游戏服务 REST API 执行发布和管理任务。
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[],[],null,["# Get started with Google Play Games Services\n\nThis page outlines how to set up [Google Play Games Services](/games/pgs/overview) and then\nadd features to an Android game. The tasks include setting up the service in\nGoogle Play Console and adding features to your game, such as sign-in and\nachievements.\n\nTo go straight to the guides for each programming language, use these links:\n\n[C and CPP](/games/pgs/cpp/cpp-start)\n[Unity](/games/pgs/unity/unity-start)\n[Java](/games/pgs/android/android-start)\n\nThe Play Games Services setup tasks are common for C and Java games. However,\nthe tasks that set up your game project and add Play Games Services features\nare specific to the main programming language used in the game project. The get\nstarted tasks for Unity games have additional difference because they use a\n[plugin](/games/pgs/unity/overview) for Play Games Services instead of having\nan additional set of C# APIs.\n\nHere are the basic steps to set up Play Games Services for a game and add\nfeatures:\n\n1. [Set up](#setup-pgs) Play Games Services.\n\n2. [Set up your game project](#setup-project) and integrate the Sign-in\n service.\n\n3. Set up and [add features](#add-features) to your game project.\n\n4. [Test and Publish](#test-publish) any changes you make to your\n Play Games Services features.\n\nBefore you start\n----------------\n\nYou must have a Google Play Developer account set up in\nPlay Console. For more information, see the\n[Register for a Google Play Developer account](https://support.google.com/googleplay/android-developer/answer/6112435).\n\nSet up Play Games Services\n--------------------------\n\n- To set up Play Games Services in Google Play Console, see the\n [set up](/games/pgs/console/setup) guide.\n\n- For Unity games: If you are developing your game in Unity, after you\n complete these, you must perform additional steps to configure the\n [Google Play Games plugin for Unity](/games/pgs/unity/overview). See the\n [plugin set up](/games/pgs/unity/unity-start) guide for details.\n\nSet up your game project\n------------------------\n\nYou must set up a Play Games Services in your game project and integrate the\n[Sign-in service](/games/pgs/signin) before adding other\nPlay Games Services features. See the following guides for details. These tasks\nare specific to the main programming language used by your game project:\n\n- [C and C++ games](/games/pgs/cpp/cpp-start)\n\n- [Unity games](/games/pgs/unity/unity-start)\n\n- [Java games](/games/pgs/android/android-signin)\n\nAdd additional features\n-----------------------\n\nAfter you integrate sign-in, you can add additional Play Games Services\nfeatures to your game. This involves setting up the feature in\nPlay Console and then integrating the API in your game project.\nSee the following guides for details:\n\n- [Achievements](/games/pgs/achievements)\n\n- [Leaderboards](/games/pgs/leaderboards)\n\n- [Events](/games/pgs/events)\n\n- [Friends](/games/pgs/friends)\n\n- [Saved games](/games/pgs/savedgames)\n\nTest and publish Play Games Services updates\n--------------------------------------------\n\nAfter you add Play Games Services features to your game project, you should\ntest any updates you make to your Play Games Services project using the\n[test accounts](/games/pgs/console/setup#start) that you setup when you\nconfigure Play Games Services. When you're satisfied with the changes, you can\nuse Play Console to [publish](/games/pgs/console/publish) them.\nThis does not involve publishing your game, and only updates the\nPlay Games Services project and services hosted by Google.\n\nWhat's next\n-----------\n\nAfter you set up Play Games Services and add features to your game, you can use\nthe Play Games Services REST APIs for\n[publishing](/games/pgs/publishing/publishing) and\n[management](/games/pgs/managment/managment) tasks."]]