> For the complete documentation index, see [llms.txt](https://docs.convai.com/api-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/getting-started/prerequisites.md).

# 前提条件

在安装 Convai Unity SDK 之前，请确认你的环境满足以下要求。缺少其中任何一项都将导致安装错误或运行时失败，而且事后更难排查。

### 系统要求

| 要求       | 最低                                                             |
| -------- | -------------------------------------------------------------- |
| Unity 版本 | <code class="expression">space.vars.unity\_min\_version</code> |
| 脚本后端     | Mono 或 IL2CPP                                                  |
| 互联网连接    | 在编辑器和运行时均需要                                                    |

{% hint style="warning" %}
Convai Unity SDK 需要 Unity <code class="expression">space.vars.unity\_min\_version</code>。如果你的项目使用的是较旧的 LTS 版本，请在继续之前升级。
{% endhint %}

### 所需的 Unity 包

该 SDK 依赖三个 Unity 包。两种安装方式（Package Manager 和 Asset Store）都会自动安装这些包——除非遇到版本冲突，否则你无需手动添加它们。

| 包                                 | 最低版本   |
| --------------------------------- | ------ |
| `com.unity.nuget.newtonsoft-json` | 3.2.2  |
| `com.unity.ugui`                  | 2.0.0  |
| `com.unity.inputsystem`           | 1.18.0 |

如果你的项目已经在 `com.unity.inputsystem` 或 `com.unity.ugui` 中将 `Packages/manifest.json`，锁定为较旧版本，自动安装将会静默失败，或者产生版本冲突。安装 SDK 之前，请移除或更新现有的版本锁定。

### 支持的渲染管线

| 渲染管线         | 支持 |
| ------------ | -- |
| 内置渲染管线       | ✓  |
| 通用渲染管线（URP）  | ✓  |
| 高清渲染管线（HDRP） | ✓  |

有关详细的平台和渲染管线兼容性，请参见 [兼容性与要求](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/compatibility-and-requirements.md).

### 账户要求

你需要一个有效的 Convai 账户和一个 API 密钥，才能将你的项目连接到 Convai。

1. 如果你还没有账户，请在 [convai.com](https://convai.com) 创建一个账户。
2. 请从 Convai 控制面板的 **API 密钥** 部分获取你的 API 密钥。
3. 在 Convai 控制面板中至少创建一个角色，并记下其 **角色 ID** ——你在场景设置时会用到它。

你的 API 密钥存储在 `Assets/Resources/ConvaiSettings.asset`中。如果你的项目使用源代码管理，请根据你团队的安全策略决定是否提交此文件。另请参见 [配置 API 密钥](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/getting-started/configure-api-key.md) ，了解完整的设置步骤和安全部署选项。

### 下一步

一旦你的环境满足上述所有要求，就安装 SDK。

{% content-ref url="/pages/f1f8700aca8f1ecef5696ae3f482c57ceae1064c" %}
[安装 Convai Unity SDK](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/getting-started/installation.md)
{% endcontent-ref %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/getting-started/prerequisites.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
