> 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><tr><td><strong>实体化</strong><br>用于角色行为的凝视、身体动画、肢体语言、对话流程和情绪模块。</td><td><a href="/pages/592c2c480eec89e08874079462467e5bb5798a89">/pages/592c2c480eec89e08874079462467e5bb5798a89</a></td></tr><tr><td><strong>AI 编码助手</strong><br>Unity MCP 集成，可让 AI 编码代理通过提示构建 Convai 场景。</td><td><a href="/pages/d8c18409ae9c4e08b59f112c685f31eedd8cba20">/pages/d8c18409ae9c4e08b59f112c685f31eedd8cba20</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 情绪信号映射到面部混合形状或 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>

### 参考资料和指南

<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> 引入了角色行为模块的具身化系列：凝视、身体动画、肢体语言、对话流程和情绪。这五个模块共享同一套按角色配置，并读取相同的对话状态，因此角色的外观、动作和反应会作为一个整体行为来呈现，而不是五个独立行为。此版本还新增了 Auth Token 认证模式，它会在每次连接前解析一个短期凭证，因此玩家构建版本无需包含账户 API 密钥。Actions Editor 围绕一个精选的 21 个内置动作目录进行了重建，并以一次可撤销操作同时配置某个动作的执行器及其角色侧组件。一个新的 `Convai > 故障排查工具` 窗口会按模块报告设置问题。该 SDK 需要 Unity <code class="expression">space.vars.unity\_min\_version</code>。另请参见 [发行说明](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/overview/release-notes.md) 以查看完整更新日志。

### 下一步

安装 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, and the optional `goal` query parameter:

```
GET https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/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.
