> 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.md).

# Convai Unity SDK

Convai Unity SDK 将 Unity 项目连接到 Convai，将对话式 AI 带入训练模拟、交互式体验和游戏中。角色可实时处理语音，以自然语言响应，并同步唇部动作、面部表情和身体动画——所有这些都可按项目进行配置。每个功能都是一个独立模块：只添加项目需要的部分，并按最适合您工作流程的顺序进行。

{% hint style="info" %}
**SDK 新手？** 跟随 [快速开始](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/getting-started.md) 安装软件包、配置 API 密钥并运行您的第一个 AI 角色。
{% endhint %}

### 了解 SDK

<table data-view="cards"><thead><tr><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>概述</strong><br>SDK 是什么、其结构如何，以及何时使用各个模块。</td><td><a href="/pages/e1b58f4b7b487b6896c74198b666a3fa66d13506">/pages/e1b58f4b7b487b6896c74198b666a3fa66d13506</a></td></tr><tr><td><strong>兼容性和要求</strong><br>Unity 版本、渲染管线、平台支持和网络要求。</td><td><a href="/pages/55576a48120f0ea393eac65ad3f16a76f2c8b45b">/pages/55576a48120f0ea393eac65ad3f16a76f2c8b45b</a></td></tr><tr><td><strong>核心概念</strong><br>会话生命周期、轮流发言模式以及 SDK 事件系统。</td><td><a href="/pages/b20dffbec401e06e9fe4168f409ab42a87fa327b">/pages/b20dffbec401e06e9fe4168f409ab42a87fa327b</a></td></tr></tbody></table>

### 功能

每个功能都是一个您可选择启用的独立模块。

<table data-view="cards"><thead><tr><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>动作</strong><br>角色执行由 Convai 派发的结构化场景内命令。</td><td><a href="/pages/48542e3f43c9fa4320574cae5c541c172f781a1d">/pages/48542e3f43c9fa4320574cae5c541c172f781a1d</a></td></tr><tr><td><strong>情绪</strong><br>将 Convai 情绪信号映射到面部 BlendShape 或 Animator 参数。</td><td><a href="/pages/4fce72c6ad15ed3dd08bc857832b3067da875c10">/pages/4fce72c6ad15ed3dd08bc857832b3067da875c10</a></td></tr><tr><td><strong>长期记忆</strong><br>角色会在不同会话之间记住每个玩家。</td><td><a href="/pages/619185ebc41c18d7fc15c71b6aaa2a22367ff0a6">/pages/619185ebc41c18d7fc15c71b6aaa2a22367ff0a6</a></td></tr><tr><td><strong>视觉</strong><br>角色可通过 Unity 摄像机、网络摄像头或 Meta Quest 透视功能进行观察。</td><td><a href="/pages/b40605131fc22d0b4a7a0e62e0e97c744ec19d0e">/pages/b40605131fc22d0b4a7a0e62e0e97c744ec19d0e</a></td></tr><tr><td><strong>动态上下文</strong><br>可随时将运行时状态和事件注入角色知识中。</td><td><a href="/pages/eb13f9c057b5d7a65a7d8338048c0f7def05d5cf">/pages/eb13f9c057b5d7a65a7d8338048c0f7def05d5cf</a></td></tr><tr><td><strong>叙事设计</strong><br>与对话流程相绑定的触发式剧情章节推进。</td><td><a href="/pages/892f091d719fc0313f9c15cd06a5133939efee0e">/pages/892f091d719fc0313f9c15cd06a5133939efee0e</a></td></tr><tr><td><strong>场景元数据</strong><br>角色会自动读取场景对象的上下文信息。</td><td><a href="/pages/3e23af730226f449644f6a9c60f206a69124eb0e">/pages/3e23af730226f449644f6a9c60f206a69124eb0e</a></td></tr></tbody></table>

### 实用工具

完全在 Unity 内运行的辅助模块——无需 Convai 通信。

<table data-view="cards"><thead><tr><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>对话动画</strong><br>在说话期间驱动身体和头部动作的四层 Animator 堆栈。</td><td><a href="/pages/4855debc1a41a36a77ffcd2af49d786a7ffa1236">/pages/4855debc1a41a36a77ffcd2af49d786a7ffa1236</a></td></tr><tr><td><strong>视线与注意力</strong><br>眼神和头部注视会混合朝向关注目标和对话伙伴。</td><td><a href="/pages/ef7ab7a7a63bf2b7dbe5e891064030f0baab789b">/pages/ef7ab7a7a63bf2b7dbe5e891064030f0baab789b</a></td></tr></tbody></table>

### 参考资料与指南

<table data-view="cards"><thead><tr><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>UI 与呈现</strong><br>转录 UI、字幕模式、通知系统和设置面板。</td><td><a href="/pages/2b8bcd9f29dcc2b30d5e7e6151d3dfdd57b6ed76">/pages/2b8bcd9f29dcc2b30d5e7e6151d3dfdd57b6ed76</a></td></tr><tr><td><strong>脚本参考</strong><br>会话事件、角色事件和转录系统的完整 API 参考。</td><td><a href="/pages/0c50993bf7f808e1095d4063ea417f6a0f9fed5e">/pages/0c50993bf7f808e1095d4063ea417f6a0f9fed5e</a></td></tr><tr><td><strong>平台指南</strong><br>WebGL、Android、iOS 和 Meta Quest 部署指南。</td><td><a href="/pages/c548f38700d19163b7037cf3152f210077f0967b">/pages/c548f38700d19163b7037cf3152f210077f0967b</a></td></tr><tr><td><strong>高级主题</strong><br>自定义提供程序、性能以及 SDK 扩展点。</td><td><a href="/pages/88133ee9286cf8e79d37845227b72f2a4be61b4b">/pages/88133ee9286cf8e79d37845227b72f2a4be61b4b</a></td></tr><tr><td><strong>故障排查</strong><br>常见故障模式、诊断步骤和已知问题。</td><td><a href="/pages/aed151614a7019028126be07590213a17602a2f2">/pages/aed151614a7019028126be07590213a17602a2f2</a></td></tr></tbody></table>

### 最新版本

v<code class="expression">space.vars.unity\_sdk\_version</code> 引入了结构化动作，用于精确派发场景内命令；为增强现实中的角色感知提供了 Meta Quest 透视视觉；支持运行时轮流发言模式切换；并扩展了动态上下文，以丰富 NPC 知识。

### 下一步

请安装 Convai Unity SDK，并通过“快速开始”部分连接您的第一个 AI 角色。如果您在安装前评估 SDK，请查看 [兼容性和要求](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/compatibility-and-requirements.md) 以确认平台和 Unity 版本支持。

{% content-ref url="/pages/5ea68df21c8a54f95779af92056a9ab831531be5" %}
[快速上手](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/getting-started.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.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.
