> 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/unity-plugin-beta-overview/installation-and-setup.md).

# 安装与设置

## 简介

Convai Unity 插件（Beta）可让你将 Convai 的先进对话式 AI 角色无缝集成到你的 Unity 项目中。该插件简化了设置流程，并提供一个可直接运行的演示场景，让你能够立即开始与由 Convai 驱动的角色互动。

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

***

## 安装指南

按照以下步骤安装并配置 Convai Unity 插件 Beta。

### 1. 下载插件

下载下方提供的 ZIP 文件。

{% file src="/files/93cc67d8f45d4be6955e1094cec1b1419690048d" %}

## **Beta 注意事项**

{% hint style="danger" %}
此软件包是一个入门级 **Beta 版本** ，旨在提供一个可直接使用、兼容 MR 的示例，其中包含所需的 Meta 软件包。\
请注意， **此版本不支持 LipSync**。未来的版本将引入其他功能，包括完整的 LipSync 支持。
{% endhint %}

### 2. 解压软件包

解压下载的 `.zip` 文件到你电脑上的首选位置。

### 3. 创建一个新的 Unity 项目

1. 打开 **Unity Hub**.
2. 点击 **新建项目**.
3. 选择你偏好的 Unity 版本（**建议使用 Unity 6 或更高版本**).
4. 选择 **Universal 3D** 模板。
5. 为你的项目命名，然后点击 **创建项目**.

{% hint style="info" %}
Convai Unity 插件支持 **Unity 2022 及以上版本**.
{% endhint %}

Unity 现在将创建并打开你的新项目。

### 4. 导入 Convai 插件包

1. 项目打开后，导航到顶部菜单并选择 **Assets → Import Package → Custom Package**.
2. 在文件对话框中，找到并选择 **Convai Unity 包** ，这是你从 `.zip` 文件。
3. 点击 **导入** 中解压得到的，以便将 Convai 插件添加到你的项目中。
4. 导入完成后，Convai 插件就可以在 Unity 中进行配置了。
5. 接下来，打开自动出现的 **项目设置工具** 。
6. 同时选择 **PC** 和 **Meta Quest** 平台，并点击 **一键修复** 来确保每个平台都正确配置。

***

## 项目设置

### 设置你的 API 密钥

1. 前往 **顶部菜单** → **Convai**.
2. 选择 **帐户** 下拉菜单中。
3. 在 **API 密钥** 字段中，粘贴你的 Convai API 密钥（你可以从你的 [Convai 控制台](https://convai.com/)).

***

### 打开示例场景

若要探索 Convai 示例设置：

1. 导航到：\
   `Assets/Convai/Demo/Scenes/Convai Sample Scene.unity`
2. 打开该场景。
3. 在 **顶部菜单**，前往 **Window → TextMeshPro → Import TMP Essential Resources** 以启用文本渲染。
4. 导入后，添加你的 **角色名称和 ID**:
   * 在 **层级**，选择 `ConvaiNPC` 游戏对象。
   * 在 **检查器**，找到 **ConvaiNPC** 组件。
   * 输入你的 **角色名称** 在 *角色名称* 字段。
   * 粘贴你的 **Character ID** 在 *Character ID* 字段。

***

### 为构建做准备

1. 前往 **文件 → Build Profiles**.
2. 在 **场景列表**，右键单击默认的 *示例场景* 并将其移除。
3. 点击 **添加打开的场景** 以包含 *Convai 示例场景* ，代替它。
4. 在 **配置文件**，选择 **Meta Quest** 并点击 **切换平台** ，位于右下角。
5. 从顶部菜单进入 **Meta XR Tools → Project Setup Tool**.
   * 在打开的窗口中，点击 **一键修复** ，分别对两者 **PC** 和 **Meta Quest**.
6. 返回到 **Build Profiles** 窗口。
   * 如果在 **运行设备**下选择了设备，点击 **构建并运行** 以直接部署到你的头显。
   * 如果未选择设备，点击 **构建** 以手动生成构建。

***

## 结论

你现在已经完成 Convai Unity 插件（Beta）的设置，并为你的项目做好了面向 MR 的开发准备。\
从现在开始，你可以开始定制示例场景、集成你自己的 Convai 角色，并扩展该插件的功能，以满足项目在交互、游戏玩法或 AI 驱动设计方面的需求。

随着未来版本带来新功能、改进以及 LipSync 支持，你将能够进一步提升体验，并构建更具沉浸感、更智能且以语音驱动的 Unity 应用。


---

# 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/unity-plugin-beta-overview/installation-and-setup.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.
