> 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

为 Unity 训练模拟、交互式体验和游戏添加实时 AI 角色——支持语音、情绪、动作和持久记忆。

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="/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/overview.md">Convai Unity SDK 概览</a></td></tr><tr><td><strong>兼容性和要求</strong><br>Unity 版本、渲染管线、平台支持和网络要求。</td><td><a href="/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/compatibility-and-requirements.md">兼容性与要求</a></td></tr><tr><td><strong>核心概念</strong><br>会话生命周期、轮流发言模式以及 SDK 事件系统。</td><td><a href="/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/core-concepts.md">核心概念</a></td></tr><tr><td><strong>具身</strong><br>用于角色行为的凝视、身体动画、肢体语言、对话流程和情绪模块。</td><td><a href="/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/embodiment.md">具身化</a></td></tr><tr><td><strong>AI 编码助手</strong><br>Unity MCP 集成，让 AI 编码代理可以通过提示构建 Convai 场景。</td><td><a href="/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/ai-coding-assistant.md">AI 编码助手</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="/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/character-actions.md">角色动作</a></td></tr><tr><td><strong>情绪</strong><br>将 Convai 情绪信号映射到面部混合形状或 Animator 参数。</td><td><a href="/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/embodiment/emotion.md">情绪</a></td></tr><tr><td><strong>长期记忆</strong><br>角色会在不同会话之间记住每位玩家。</td><td><a href="/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/long-term-memory.md">长期记忆</a></td></tr><tr><td><strong>视觉</strong><br>角色可通过 Unity 相机、摄像头或 Meta Quest 透视功能进行观察。</td><td><a href="/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/vision.md">视觉</a></td></tr><tr><td><strong>动态上下文</strong><br>可随时将运行时状态和事件注入角色知识中。</td><td><a href="/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/dynamic-context.md">动态上下文</a></td></tr><tr><td><strong>叙事设计</strong><br>与对话流程相关联的基于触发器的剧情段推进。</td><td><a href="/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/narrative-design.md">叙事设计</a></td></tr><tr><td><strong>场景元数据</strong><br>角色会自动读取有关场景对象的上下文信息。</td><td><a href="/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/scene-metadata.md">场景元数据</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>转录界面、字幕模式、通知系统和设置面板。</td><td><a href="/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/ui-and-presentation.md">UI 与呈现</a></td></tr><tr><td><strong>脚本参考</strong><br>会话事件、角色事件以及转录系统的完整 API 参考。</td><td><a href="/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/scripting-reference.md">脚本参考</a></td></tr><tr><td><strong>平台指南</strong><br>WebGL、Android、iOS 和 Meta Quest 部署指南。</td><td><a href="/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/platform-guides.md">平台指南</a></td></tr><tr><td><strong>高级主题</strong><br>自定义提供程序、性能和 SDK 扩展点。</td><td><a href="/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/advanced-topics.md">自定义并扩展 SDK</a></td></tr><tr><td><strong>故障排除</strong><br>常见故障模式、诊断步骤和已知问题。</td><td><a href="/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/troubleshooting.md">故障排查</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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
