> 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/features/emotion/quick-start.md).

# 情绪快速开始

我们将把 Emotion Controller 绑定到一个 NPC 上，分配附带的示例配置文件，并在 Play Mode 中查看角色的面部如何对实时 AI 情绪信号作出反应。初始设置不需要自定义资源。

### 先决条件

开始之前，请确认：

* [ ] 一个 `ConvaiCharacter` 已在场景中，并在 Play Mode 中对语音作出响应

### 设置 Emotion Controller

{% stepper %}
{% step %}

#### 添加 Emotion Controller

在 Hierarchy 中选择你 NPC 的根 GameObject。在 Inspector 中，点击 **Add Component** 并搜索 **Emotion Controller**，或者导航到 **Convai → Embodiment → Emotion Controller**.

该组件会显示一个 **Profile** 字段，目前为空。

<figure><img src="/files/e834c78c4a301dd5d234620242ff7d57656832cc" alt="Unity Inspector showing ConvaiEmotionController added to the NPC root GameObject with the Profile field empty, ready for a profile asset to be assigned"><figcaption><p>已将 ConvaiEmotionController 添加到 NPC 根对象——在第 3 步分配 EmotionProfile 资源之前，Profile 字段为空。目前还没有启用任何 blendshape 映射。</p></figcaption></figure>
{% endstep %}

{% step %}

#### 查找附带的示例配置文件

在 Project 窗口中，导航到：

{% code overflow="wrap" %}

```
Packages / Convai SDK for Unity / SamplesShared / Resources / Embodiment / Modules / Emotion
```

{% endcode %}

你会找到两个资源：

| 资源                                    | 用途                                        |
| ------------------------------------- | ----------------------------------------- |
| `ConvaiSamplesShared_EmotionProfile`  | 为 Reallusion 角色预先配置的表情槽位，平滑、微爆发和中性轮换都已调好。 |
| `ConvaiSamplesShared_EmotionTaxonomy` | 默认的情绪词汇表，已被上面的配置文件引用。                     |
| {% endstep %}                         |                                           |

{% step %}

#### 分配配置文件

将 `ConvaiSamplesShared_EmotionProfile` 从 Project 窗口拖到 **Profile** 字段中，位于 `ConvaiEmotionController` 组件上。

<figure><img src="/files/ef51f792df1ee5e09263f05f80a049a735b27ad2" alt="Unity Inspector showing ConvaiEmotionController with ConvaiSamplesShared_EmotionProfile assigned to the Profile field"><figcaption><p>已分配 ConvaiSamplesShared_EmotionProfile——控制器现在已使用为 Reallusion 角色预调好的表情槽位进行配置，并会在 Play Mode 开始后立即驱动 blendshape。</p></figcaption></figure>

{% hint style="warning" %}
附带的资源是 **只读的** ——它位于包内。如需调整任何设置，请先复制它（**Ctrl+D** 在 Windows 上 / **Cmd+D** 在 macOS 上），然后将副本移动到你自己的 `Assets/` 文件夹中，并改为分配这个副本。
{% endhint %}
{% endstep %}

{% step %}

#### 进入 Play Mode 并说话

按 **Play**。使用你配置好的麦克风与角色对话。随着 AI 回复，请观察 Inspector 中的 `ConvaiEmotionController` —— **Current** 读数会实时更新。
{% endstep %}
{% endstepper %}

{% hint style="success" %}
**预期结果：** 随着对话推进，NPC 的面部表情会发生变化。 **Current → Dominant Label** 字段显示当前激活的情绪，而 **Current → Dominant Score** 显示其平滑后的强度。如果你使用的是带默认骨架的 Reallusion 角色，blendshape 会立即在角色面部生效。
{% endhint %}

### 工作原理

当你与角色对话时， `ConvaiEmotionController` 接收后端的情绪信号，通过词汇分类法进行解析（映射 `"happy"` 设为 `"joy"`），随时间对强度分数进行平滑处理，并在每一帧将该分数写入角色的面部 blendshape。要了解每个阶段的完整说明，请参见 [情绪系统如何工作](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/emotion/how-the-emotion-system-works.md).

附带的配置文件针对 Reallusion 角色进行了配置。对于其他骨架，请复制该配置文件，并更新每个槽位中的 blendshape 名称，使其与角色的形状匹配。请参见 [情绪配置文件](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/emotion/emotion-profile.md) 和 [情绪输出绑定](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/emotion/output-bindings.md) 了解如何为任何骨架配置槽位。

### 下一步

快速开始可使用附带的配置文件端到端运行。这些页面介绍了如何调优和扩展该设置。

{% content-ref url="/pages/a169ddd3c944e6f42f2701922ad7b55a03ac789a" %}
[情绪系统的工作原理](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/emotion/how-the-emotion-system-works.md)
{% endcontent-ref %}

{% content-ref url="/pages/5a9247365092d958f2d539ae98bdfe69f72df091" %}
[情绪配置文件](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/emotion/emotion-profile.md)
{% endcontent-ref %}

{% content-ref url="/pages/931fe5969b6c7b83aac82771a8aedc0f94f896d1" %}
[情绪输出绑定](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/emotion/output-bindings.md)
{% endcontent-ref %}

{% content-ref url="/pages/39d161d99d04e6ca98725c740d134ccb5eac9e73" %}
[情绪脚本 API](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/emotion/scripting-api.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/features/emotion/quick-start.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.
