> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 将 Unity 游戏迁移到 Google Play Games 登录

> 将 Unity Android 玩家从 PlayFab 的 LoginWithGoogleAccount API 迁移到 Google Play Games 登录以及更新的 Play Games Plugin 版本的概述。

## 何时可能需要迁移

如果你之前在 Android 上的 Unity 游戏中使用 PlayFab LoginWithGoogleAccount API，你可能已经注意到，使用最新版本 (>= 0.11.x) 的 [Play Games Plugin for Unity](https://github.com/playgameservices/play-games-plugin-for-unity) 时，你不再能够获取此 API 所需的 ServerAuthCode。

这是因为 PlayFab LoginWithGoogleAccount API 需要“profile”作用域才能工作。但是，Play Games Plugin for Unity 的最新版本 (>= 0.11.x) 不支持添加额外作用域的能力，使得依赖 LoginWithGoogleAccount API 的游戏开发者无法将其游戏升级到该插件的最新版本。

我们已意识到此问题，并确定了一种使 PlayFab LoginWithGoogleAccount API 与 Play Games Plugin for Unity 0.11.x 版本配合工作的方法。但是，推荐的操作方式是在仍处于 0.10.x 版本时将现有玩家迁移（关联）到他们的 Play Games 配置文件，这将消除对使用 PlayFab LoginWithGoogleAccount API 的依赖。一段时间后，将之前提到的修复用作 0.10.x 时未迁移的剩余玩家的回退方法。

推荐的操作方式如下：

1. 在仍处于 0.10.x 时，使用下面的迁移过程步骤迁移你的玩家，确保跟踪哪些用户已经迁移到使用 LoginWithGooglePlayGamesServices。由于我们要求玩家打开游戏以迁移他们，在此期间有些玩家可能未被有效迁移。

   [LoginWithGooglePlayGamesServices 迁移过程步骤](/services/playfab/identity/player-identity/platform-specific-authentication/google-play-games-sign-in-migration-details)

2. 对于在此期间无法迁移的其余现有玩家，使用下面的修复步骤在插件的 0.11.x 版本中继续使用 LoginWithGoogleAccount，由于必须通过浏览器登录可能会影响玩家的体验，因此应将此视为回退方案。

   [LoginWithGoogleAccount 修复步骤](/services/playfab/identity/player-identity/platform-specific-authentication/google-play-games-sign-in-migration-fallback)


## Related topics

- [在 Unity 中从 Google Sign-in 迁移到 Google Play Games](/zh-CN/services/playfab/identity/player-identity/platform-specific-authentication/google-play-games-sign-in-migration-details.md)
- [将 XDK 网络迁移到 XBOX GDK](/zh-CN/build/console-features/networking/xdk-migration/index.md)
- [Google Sign-in 到 Play Games 登录的迁移回退方案](/zh-CN/services/playfab/identity/player-identity/platform-specific-authentication/google-play-games-sign-in-migration-fallback.md)
- [从上一代 XBOX 移植](/zh-CN/paths/porting/from-xbox-era.md)
- [XBOX One Software Development Kit 迁移指南](/zh-CN/build/console-features/networking/xdk-migration/xdk-migration-toc.md)
