> For the complete documentation index, see [llms.txt](https://docs.edgegap.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.edgegap.com/zh/unity/developer-tools.md).

# 开发者工具

我们为您打造这些工具，秉持一个简单的信条：“成功团队的关键是快速迭代和频繁测试”。如果您发现任何改进机会，请在我们的 [社区 Discord](https://discord.gg/NgCnkHbsGp). 我们希望您会享受到流畅的体验。🚀

{% hint style="info" %}
[查找真实世界示例](/zh/docs/sample-projects/unity-netcodes.md) 您可以将其用作项目起点，并进一步修改。
{% endhint %}

#### 语义化版本控制

我们的开发者工具和托管服务使用官方 [语义化版本控制](https://semver.org/)，表明哪些更新是✅安全的（次要、补丁），哪些可能包含⚠️破坏性更改（主要）。

**一旦某个版本发布，它将永远不会被修改/更改**.

## ⚡ 专用服务器快速启动插件

直接从您的 Unity 编辑器中构建并将您的专用游戏服务器启动到云端！

* [Unity 专用服务器插件 - 交钥匙解决方案、源代码和完整发行说明。](https://github.com/edgegap/edgegap-unity-plugin)

{% hint style="success" %}
此插件 100% 免费提供，受免费层条款和条件约束。
{% endhint %}

自 2021.3+ 起的所有 Unity3D 长期支持（LTS）版本均受官方支持。

此插件包含旨在帮助您完成以下任务的功能：

* 为 Linux 构建并容器化您的专用服务器，
* 在本地测试您服务器的 Docker 镜像，
* 将您的服务器上传并部署到 Edgegap 上。

{% hint style="info" %}
此插件不会修改任何游戏行为，它只是 Edgegap 任务的一个便捷开发工具。该插件不包含在您的构建中，因为它仅在服务器构建准备期间使用。
{% endhint %}

#### 安装

请参阅 [官方插件仓库](https://github.com/edgegap/edgegap-unity-plugin) 以获取安装的详细说明。

{% embed url="<https://youtu.be/3a5veDyxpoE>" %}

<details>

<summary>安装 Unity Linux 构建支持模块</summary>

* 使用 Unity Hub 选择 选项卡 **安装**，访问 **设置** 和 **添加模块** 对于您打算与 Edgegap 平台一起使用的每个 Unity 版本：

<figure><img src="/files/563f83de58ec91755c48c56b82376f73e54bdde9" alt=""><figcaption></figcaption></figure>

* 向下滚动以选择并安装以下 Unity 模块：
  * **Linux 构建支持（IL2CPP），**
    * **Linux 构建支持（Mono），**
    * **Linux 专用服务器构建支持**

<figure><img src="/files/fab307f7657f39c2c6dff6cae4911cbc8460b8ea" alt=""><figcaption></figcaption></figure>

</details>

<details>

<summary><a href="https://www.docker.com/products/docker-desktop/">安装 Docker Desktop（或 Docker CLI）</a></summary>

* [从官方来源安装 Docker Desktop](https://www.docker.com/products/docker-desktop/) （无需账户）。
* 完成安装后重启计算机。

</details>

{% hint style="success" %}
参见 [Unity](/zh/unity.md) 以开始使用并查看插件使用的详细说明。
{% endhint %}

<details>

<summary>故障排除和常见问题</summary>

Unity 错误： `[包管理器窗口] 添加包时出错：https://github.com/edgegap/edgegap-unity-plugin.git`

* 要通过 git URL 添加我们的插件，您[#installation](#installation "mention")).

***

Unity 错误： `缺少 Linux 构建支持`

* 参见 [#usage-requirements](#usage-requirements "mention"), 您很可能缺少 Linux 构建支持模块，您可以通过 Unity Hub 安装它们。请确保选择与您的项目相同的 Unity 版本。

</details>

{% hint style="info" %}
如果你需要帮助， [请通过 Discord 联系我们](https://discord.gg/MmJf8fWjnt)。关于实时游戏支持，请查看我们的 [工单系统](https://edgegap.atlassian.net/servicedesk/customer/portal/3).
{% endhint %}

{% hint style="info" %}
**针对插件开发者** - 如果您希望在用户的编辑器中检测此插件是否存在，可以使用编译指令来实现 `#if EDGEGAP_PLUGIN_SERVERS {your code} #endif` .
{% endhint %}

## ⭐ 软件开发工具包

{% hint style="info" %}
**Unity SDK 的最新版本是 `3.3.0`**。本文档中的所有示例都是最新的。
{% endhint %}

Unity SDK 包含用于部署、配对和服务器浏览器的可选集成工具。此插件官方支持 Unity 2021.3.0f1 及更高版本。

{% hint style="success" %}
此插件依据免费版条款与条件，100% 免费提供。
{% endhint %}

#### 要求

<details>

<summary>安装 Git 客户端（例如 <a href="https://git-scm.com/">git-scm</a>)</summary>

Unity 需要 Git 客户端来自动下载并安装我们的 Unity 包。安装完成后，您将不需要直接使用 git。

</details>

#### 安装

1. 打开您的 Unity 项目，
2. 选择 `Window > Package Management > Package Manager` ,
3. 点击 :heavy\_plus\_sign: 图标并选择 `Add package from git URL...` ,
4. 在提示时输入我们 SDK 的 URL：

{% code title="" %}

```
https://github.com/edgegap/edgegap-unity-sdk.git
```

{% endcode %}

5. 点击 `Add`  并等待安装完成。

#### 导入示例

此包包含多个示例，旨在单独使用（不要将示例组合在一起）。

#### 已验证来源

这是此 SDK 唯一的官方分发渠道，请勿信任未经验证的来源！

#### 更新包

在 Unity Package Manager 中导航到 Edgegap SDK，然后点击 `更新` .

{% hint style="warning" %}
**导入的示例不会自动更新！** 备份任何自定义属性值，删除当前场景中使用的示例脚本，然后重新导入示例。
{% endhint %}

{% hint style="info" %}
某些版本可能包含破坏性变更。这将由新的主版本号标明。
{% endhint %}

#### 更新到 v3

此更新包含许多新的 [服务器浏览器](/zh/unity/fu-wu-qi-liu-lan-qi.md) 工具和示例，改进了配对错误处理等。请查看 [发布说明](/zh/docs/release-notes.md) 以获取完整列表。

{% hint style="warning" %}
Unity SDK v3 更新包含一些破坏性变更。请仔细重新测试您的集成。
{% endhint %}

<details>

<summary>故障排除和常见问题</summary>

Unity： `[包管理器窗口] 添加包时出错：https://github.com/edgegap/edgegap-unity-sdk.git`

* 要通过 git URL 添加我们的插件，您需要安装 git 客户端。

***

Visual Studio： `找不到类型或命名空间名称` ，用于 Edgegap 命名空间。

1. 在 Unity 编辑器中，导航到 **编辑 / 首选项 / 外部工具 / 生成 .csproj 文件**.
2. 请确保您已启用 **Git 包**.
3. 单击 **重新生成项目文件**.

</details>

{% hint style="info" %}
如果你需要帮助， [请通过 Discord 联系我们](https://discord.gg/MmJf8fWjnt)。关于实时游戏支持，请查看我们的 [工单系统](https://edgegap.atlassian.net/servicedesk/customer/portal/3).
{% endhint %}

## 📫 分布式中继传输库

为您的网络代码库找到一个自定义 Transport，以便在点对点游戏中利用分布式中继。

[查看文档](/zh/learn/distributed-relay/relay-transport-samples.md):

* 下载 Edgegap Relay 示例：
  * [Mirror 示例](https://github.com/edgegap/unity-mirror-relay-sample),
  * [FishNet 示例](https://github.com/edgegap/unity-fishnet-relay-sample),
  * [Unity NGO 示例](https://github.com/edgegap/unity-ngo-relay-sample).
* [Edgegap Relay Transport 库 - 支持的网络代码的源代码和发行说明。](https://github.com/edgegap/distributed-relay-examples)
