> 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/overview/what-is-the-convai-unity-sdk.md).

# 什么是 Convai Unity SDK

面向 Unity 的实时对话式 AI 角色——语音管线、可选功能模块、支持的平台和最低要求。

Convai Unity SDK 将 Unity 角色连接到 Convai，使其能够实时说话、倾听、推理和行动。玩家对着麦克风说话；SDK 捕获音频，将其流式传输到 Convai 进行语音识别和语言理解，使用文本转语音生成响应，并在角色上播放，同时同步唇形、面部表情和可选的场景内动作。该 SDK 面向正在构建培训模拟、交互式体验和游戏的 Unity 开发者。

### 包含内容

该 SDK 随附完整的对话管线和一组可选择启用的功能模块。

#### 对话管线

连接后始终处于活动状态：

* **实时语音输入** — 麦克风采集、流式语音识别
* **语言理解与生成** — Convai 处理并以角色身份响应
* **文本转语音** — 由 Convai 生成的语音，通过 Unity 音频播放

#### 功能模块

可选择启用，均作为 Unity 组件添加：

* **口型同步** — 实时 blend shape 口部动画；支持 ARKit、MetaHuman 和 CC4 Extended 映射
* **情绪** — 将 Convai 的情绪信号映射到面部 blend shape 或 Animator 参数
* **动作** — 角色执行由 Convai 分发的结构化场景内命令
* **长期记忆** — 角色可在不同会话中记住每位玩家
* **叙事设计** — 与对话流程相关联的触发式故事章节推进
* **视觉** — 角色通过 Unity 摄像机、网络摄像头或 Meta Quest 透视画面进行观察
* **动态上下文** — 随时将运行时状态和事件注入角色的知识中

#### 实用工具

完全在 Unity 中运行、无需与 Convai 通信的可选辅助工具：

* **对话动画** — 四层 Animator 堆栈，在说话期间驱动身体和头部动作
* **凝视与注意力** — 眼睛和头部视线朝向焦点目标和对话伙伴进行混合过渡

#### 编辑器工具

项目设置中的 API 密钥配置、场景设置菜单、场景验证器，以及适用于每个 SDK 组件的自定义 Inspector。

### 语音 → Convai → 角色 流程

```mermaid
graph LR
    MIC[Microphone] --> RM[ConvaiRoomManager]
    RM --> |Voice stream| CLOUD[Convai]
    CLOUD --> |Audio + metadata| CHAR[ConvaiCharacter]
    CHAR --> AUD[Audio playback]
    CHAR --> MOD[Feature modules]
```

`ConvaiRoomManager` 负责与 Convai 的流式连接。 `ConvaiCharacter` 接收响应——音频、转录文本、情绪信号和动作命令——并将各项路由到相应的模块或输出。

### 要求

| 要求       | 最低要求                                                           |
| -------- | -------------------------------------------------------------- |
| Unity 版本 | <code class="expression">space.vars.unity\_min\_version</code> |
| 渲染管线     | 内置、URP 或 HDRP                                                  |
| 平台       | Windows、macOS、Linux、Android、iOS、Meta Quest、WebGL               |
| 网络       | 连接到 Convai 的互联网连接                                              |
| API 密钥   | 在以下网址注册免费账户： [convai.com](https://www.convai.com/)             |

{% hint style="info" %}
示例场景使用 URP。如果你的项目使用内置渲染管线，则这些示例只需稍作材质重新分配。SDK 本身可在这三种管线下正常工作。
{% endhint %}

Convai Unity SDK 可在以下平台获取： [Unity Asset Store](https://assetstore.unity.com/packages/tools/behavior-ai/npc-ai-engine-dialog-actions-voice-and-lipsync-convai-235621).

有关完整的平台和 Unity 版本支持矩阵，请参阅“兼容性和要求”。

{% content-ref url="/pages/55576a48120f0ea393eac65ad3f16a76f2c8b45b" %}
[兼容性与要求](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/compatibility-and-requirements.md)
{% endcontent-ref %}

### 下一步

安装 SDK 并添加你的第一个角色。

{% content-ref url="/pages/5ea68df21c8a54f95779af92056a9ab831531be5" %}
[快速开始](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/getting-started.md)
{% endcontent-ref %}

在设置之前，如需了解系统架构，请先查看下一页的架构页面。

{% content-ref url="/pages/5dbc3bfc03953952863c095fdc681a101736b9d2" %}
[Convai Unity SDK 架构](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/overview/convai-unity-sdk-architecture.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, and the optional `goal` query parameter:

```
GET https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/overview/what-is-the-convai-unity-sdk.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
