入门

适用于虚幻引擎的身份验证 SDK 是 Unity Gaming Services SDK 适用于虚幻引擎的插件的一部分。要在虚幻引擎中使用 Unity 身份验证,您首先需要安装 Unity Gaming Services SDK。

了解要求

适用于虚幻引擎的身份验证 SDK 插件支持虚幻引擎版本 4.27 到 5.3。

下载身份验证 SDK

从虚幻引擎市场网站

  1. 登录 虚幻引擎市场

  2. 访问 适用于虚幻引擎的 Unity Gaming Services SDK 市场页面适用于虚幻引擎的 Unity Gaming Services SDK 市场页面

  3. 选择在启动器中打开

  4. 跳至从 Epic Games 启动器中的步骤 4。

从 Epic Games 启动器

  1. 登录您的 Epic Games 启动器。
  2. 在 Epic Games 启动器中搜索适用于虚幻引擎的 Unity Gaming Services SDK搜索适用于虚幻引擎的 Unity Gaming Services SDK
  3. 访问适用于虚幻引擎的 Unity Gaming Services SDK 页面,然后选择免费适用于虚幻引擎的 Unity Gaming Services SDK 启动器页面
  4. 在 Epic Games 启动器中选择安装到引擎适用于虚幻引擎的 Unity Gaming Services SDK 安装按钮
  5. 打开一个新项目或现有项目。
  6. 导航到插件窗口,然后选中适用于虚幻引擎的 Unity Gaming Services SDK 旁边的框。 适用于虚幻引擎的 Unity Gaming Services SDK 插件窗口
  7. 重启虚幻引擎。

Note: If you use a version of the engine built from sources then you can access your Marketplace folder by doing the following:

  • If you're using Windows, then default path is: C:\Program Files\Epic Games\UE_5.3\Engine\Plugins\Marketplace. MacOS and Linux also have similar paths.
  • Copy the UnityGamingServicesSDK folder into your project Plugins folder. If it doesn't exist yet, create it at the root of your project.

配置身份验证 SDK

在开始使用身份验证 SDK 之前,您需要注册 Unity Gaming Services 并注册一个项目。

注册 UGS

Note: If you already signed up for Unity Gaming Services and have a registered project, skip this step.

如果您没有 Unity 帐户,请创建一个并创建一个新项目来注册 Unity Gaming Services

  1. 登录 Unity 云控制台
  2. 在侧边栏中选择探索服务
  3. 在顶部横幅中选择注册,然后按照说明操作。
  1. 登录您的 Unity 云控制台
  2. 选择标题中项目名称旁边的齿轮图标以访问您项目的设置。 项目设置齿轮图标。
  3. 常规>项目详细信息下,有一个项目 ID 字段。复制此值。 项目 ID 的复制按钮。
  4. 在虚幻引擎编辑器中,转到编辑>项目设置>插件>Unity 身份验证>Unity 项目设置
  5. 将复制的值粘贴到Unity 项目 ID字段中。
  6. 检索 Unity 环境。这是一个可选参数,用于指定您希望身份验证 SDK 与其交互的特定环境。
  7. 在 Unity 云控制台中,转到环境>您的环境,然后选择要使用的环境并复制其名称。这是我们用于环境的标识符。 Unity 云控制台中的您的环境列表。

Note: We’re copying the name of the environment, not the Environment ID. In the example above, the name is “testenv”. Using any other value causes Authentication requests to fail.

  1. 在虚幻引擎编辑器中,转到编辑>项目设置>插件>Unity 身份验证>Unity 项目设置
  2. 将复制的值粘贴到Unity 环境名称字段中。

复制这两个字段后,虚幻引擎编辑器中的项目设置应如下所示

The Unity Authentication plugin.

默认玩家资料名称字段允许为默认身份验证玩家资料指定不同的名称。您可以保留此字段,也可以根据需要对其进行自定义。

Note: A valid player profile name is between 1-30 characters, and consists of characters a-z, A-Z, 0-9, -, and _, with no spaces.

请参阅玩家资料,以详细了解身份验证 SDK 中的玩家资料。

下一步

继续进行任一集成