> 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/utilities/gaze-and-attention/how-gaze-and-attention-works.md).

# 注视与注意力如何工作

Gaze & Attention 实用工具为 AI 角色添加自然的目光接触和头部跟踪。它完全在 Unity 内运行——不会向 Convai 发送任何数据——并且独立于会话生命周期运行。两个协作层分别处理角色看向什么，以及如何看向那里。

***

### 注意层

注意层决定 **什么** 角色看向什么。它会在每一帧评估所有已注册的 `IFocusTargetProvider` 组件，并使用优先级、基于距离的相关性以及兴趣预算来选择胜出者，从而防止角色无限期地固定盯着单一目标。

***

### 目光层

目光层决定 **如何** 角色看向注意目标。它会将当前的注意信息转换为眼球旋转、头部移动、程序化扫视、眨眼以及眼睑跟随。目光权重由当前对话状态决定——角色在说话时目光更坚定，在静止时则更柔和。

***

### 组件管线

```mermaid
graph LR
    A[IFocusTargetProvider<br/>一个或多个] --> B[ConvaiAttentionController]
    B --> C[ConvaiGazeCoordinator]
    C --> D[ConvaiEyeGazeActuator]
    C --> E[ConvaiHeadLookActuator]
    D --> F[眼部骨骼 / BlendShape]
    E --> G[颈部和头部骨骼]
```

每一层都可以通过 ScriptableObject 配置文件独立配置。你可以调整注意力持续性、眼球跟踪锐度、头部范围、扫视频率以及按对话状态划分的目光权重——全部无需编写代码。

| 组件                           | 职责                                          |
| ---------------------------- | ------------------------------------------- |
| `ConvaiAttentionController`  | 每帧选择当前的焦点目标                                 |
| `ConvaiGazeCoordinator`      | 将注意输出与对话状态结合，生成 `GazeIntent`                |
| `ConvaiEyeGazeActuator`      | 根据以下内容旋转眼部骨骼并驱动 BlendShape： `GazeIntent`    |
| `ConvaiHeadLookActuator`     | 根据以下内容旋转颈部和头部骨骼： `GazeIntent`               |
| `AnimationRiggingGazeBridge` | 可选：驱动 Unity Animation Rigging 约束，而不是程序化写入骨骼 |

***

### 下一步

{% content-ref url="/pages/3c4829453494907d523e48c550daa2fe2aac5a4e" %}
[注视与注意力快速开始](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/utilities/gaze-and-attention/quick-start.md)
{% endcontent-ref %}

{% content-ref url="/pages/5b881c94bd2adefe8b932f255cffe05f31b8cd93" %}
[注意力与注视配置文件](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/utilities/gaze-and-attention/profiles-and-tuning.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/utilities/gaze-and-attention/how-gaze-and-attention-works.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.
