# 开始使用

> Install and configure the Unity Gaming Services Software Development Kit plug-in for Unreal Engine.

参考以下说明了解如何安装和配置 Unity Gaming Services SDK 插件。为您的项目安装和配置 Unity Gaming Services SDK 后，您可以对 Unity Matchmaker 使用 [C++](./integrate-using-cpp.md) 或 [Blueprint](./integrate-using-blueprints.md)。

### 包含的内容##what's-included

Unity Gaming Services SDK 将 Unity 的以下三个服务内置到一个插件中：

* [Unity Authentication](/authentication.md)
* [Unity Matchmaker](/matchmaker.md)
* [Unity Multiplay Hosting](https://www.rocketscience.gg/multiplay/)

### 要求需知##understand-the-requirements

适用于 Unreal Engine 的 Matchmaker SDK 插件支持 Unreal Engine 版本 4.27 到 5.3。

> **Warning:**
>
> **重要**：目前，Unity Matchmaker 仅支持将玩家匹配到使用 [Unity Multiplay Hosting](https://www.rocketscience.gg/multiplay/) 托管的专用服务器。Multiplay Hosting 可能会产生费用。如需了解定价详细信息，请参阅[定价](https://unity.com/solutions/gaming-services/pricing)。

> **Warning:**
>
> **重要**：Unity Matchmaker 使用一种称为 Centrifuge 的协议来处理服务器上的事件。此协议包含在插件模块 `MatchmakerServer` 中。非 PC 平台不支持 Centrifuge。使用多个游戏模块和 `.uproject` 文件中的 `TargetAllowList` 可从客户端版本中排除 `MatchmakerServer` 模块。

## 下载 Matchmaker SDK##download-the-matchmaker-sdk

### 通过 Unreal Engine Marketplace 网站##from-the-unreal-engine-marketplace-website

1. 登录 [Unreal Engine Marketplace](https://www.unrealengine.com/marketplace/en-US/store)。

2. 访问 [Unity Gaming Services SDK for Unreal Engine Marketplace](https://www.unrealengine.com/marketplace/en-US/product/unity-gaming-services-sdk-for-unreal-engine) 页面。


   **Frame:**
   ![Unity Gaming Services SDK for Unreal Engine Marketplace 页面](/api/media?file=/matchmaker/media/images/unreal-ugs-marketplace-page.png)

3. 选择 **Open in Launcher（在启动器中打开）**。

4. 跳至[通过 Epic Games Launcher](#from-the-epic-games-launcher) 中的步骤 4。

### 通过 Epic Games Launcher##from-the-epic-games-launcher

1. 登录您的 Epic Games Launcher。
2. 在 Epic Games Launcher 中搜索 **Unity Gaming Services SDK for Unreal Engine**。


   **Frame:**
   ![搜索 Unity Gaming Services SDK for Unreal Engine](/api/media?file=/matchmaker/media/images/unreal-auth-marketplace-search.png)
3. 访问 Unity Gaming Services SDK for Unreal Engine 页面，然后选择 **Free（免费）**。


   **Frame:**
   ![Unity Gaming Services SDK for Unreal Engine Launcher 页面](/api/media?file=/matchmaker/media/images/unreal-ugs-epic-launcher-page.png)
4. 在 Epic Games Launcher 中选择 **Install to Engine（安装到引擎）**。


   **Frame:**
   ![Unity Gaming Services SDK for Unreal Engine 安装按钮](/api/media?file=/matchmaker/media/images/unreal-ugs-marketplace-install.png)
5. 打开一个新项目或现有项目。
6. 导航到 Plugins（插件）窗口并选中 Unity Gaming Services SDK for Unreal Engine 旁边的复选框。


   **Frame:**
   ![Unity Gaming Services SDK for Unreal Engine 插件窗口](/api/media?file=/matchmaker/media/images/unreal-ugs-engine-plugin.png)
7. 重新启动 Unreal Engine。

> **Note:**
>
> **注意**：如果您使用从源代码构建的引擎版本，那么您可以通过执行以下操作来访问您的 Marketplace 文件夹：
>
> * 如果使用的是 Windows，则默认路径为：`C:\Program Files\Epic Games\UE_5.3\Engine\Plugins\Marketplace`。MacOS 和 Linux 也有类似的路径。
> * 将 `UnityGamingServicesSDK` 文件夹复制到您的项目 `Plugins` 文件夹中。如果文件夹尚不存在，请在项目根目录下创建。

### 配置 Matchmaker SDK##configure-the-matchmaker-sdk

Unity Matchmaker 依赖于包含在 Unity Gaming Services SDK 中的 Unity Authentication 服务。

在开始调用 Matchmaker API 并开始使用 Matchmaker 分配玩家之前，请在 [Unity Dashboard](https://cloud.unity.com/) 上配置 Unity Matchmaker 设置。否则，所有匹配请求都会失败。Unity Matchmaker 至少需要一个[带有默认池的队列](/matchmaker/advanced-topics-queues-pools.md)。

#### 配置回填##configure-backfill

通过回填可以将玩家放入低于最大玩家数量的现有匹配中。请参阅[回填文档](/matchmaker/advanced-topics-backfill.md)以了解更多信息。

在使用回填之前，请确保在 Unity Dashboard 上为您的队列启用回填。

1. 访问 [Unity Dashboard](https://cloud.unity.com/) 并选择您的项目。
2. 转到 **Multiplayer** 选项卡。
3. 转到 **Matchmaker** 选项卡，然后选择 **Queues（队列）**。
4. 选择您的 **Queue（队列）**。请参阅[创建池和队列](/matchmaker/get-started.md#create-a-queue-and-a-pool)。
5. 转到 \*\*Pools（池）\*\*选项卡，然后选择要在队列中使用的池。
6. 转到 \*\*Rules（规则）\*\*选项卡，找到已启用 Backfill（回填）的字段，确保其设置为 **True**。

## 下一步##what's-next-?

继续进行以下集成之一：

* [C++ 集成](./integrate-using-cpp.md)
* [Blueprint 集成](./integrate-using-blueprints.md)
