> 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/unity-plugin/utilities/convai-ui-prefabs.md).

# 预制 UI 预制件

我们提供了几种开箱即用的 UI 选项来显示角色和用户的转录内容，玩家可以将其与 Convai 插件一起使用。您可以使用并自定义这些预制体。

ConvaiNPC 和 ConvaiGRPCAPI 脚本会查找带有 Convai Chat UI Handler 组件的 GameObject，并将任何转录内容发送到该脚本，以便它能够显示在屏幕上。

## UI 类型

<figure><img src="/files/b96d2c4be01d2dd70c8b057f7e0ffd08c96eee7b" alt=""><figcaption></figcaption></figure>

### 聊天框

**预制体名称**：Convai 转录画布 - 聊天

用户和角色的转录内容会一个接一个地显示在可滚动的聊天框中。

<figure><img src="/files/0dcdd2296bb687d26931f8c17151edfc5373b2d0" alt=""><figcaption></figcaption></figure>

### 字幕

**预制体名称**：Convai 转录画布 - 字幕

用户和角色的转录内容会像字幕一样显示在底部。

<figure><img src="/files/bab73f74b9f380396d75663389062c76da9cdf7c" alt=""><figcaption></figcaption></figure>

### 问答

**预制体名称**：Convai 转录画布 - QA

用户的转录内容显示在顶部，而角色的转录内容显示在底部。

<figure><img src="/files/098ec88faa5d0c098f52ac6365bdc0d51176e70f" alt=""><figcaption></figcaption></figure>

### 移动端优化 UI 样式

**预制体名称**：Convai 转录画布 - 移动字幕

与 [#subtitle](#subtitle "mention") UI 相同。包含一个可按住说话的按钮。非常适合屏幕竖屏方向。

<figure><img src="/files/f7614fab7c345a99b6922eaca43de0a21b50f77d" alt="" width="328"><figcaption></figcaption></figure>

**预制体名称**：Convai 转录画布 - 移动 QA

<figure><img src="/files/75f164900c0d44eee79a5c3dbbccb961077e9b61" alt="" width="331"><figcaption></figcaption></figure>

**预制体名称**：Convai 转录画布 - 移动聊天

<figure><img src="/files/d1d294ffafad51ff57b0e5dfa4d4eb3c8d73cfdb" alt="" width="327"><figcaption></figcaption></figure>

## [Convai Chat UI Handler 组件](/api-docs/zh/cha-jian-yu-ji-cheng/unity-plugin/utilities/transcript-ui-system.md)

<figure><img src="/files/75e00faf11be8f84230e235f205d2506b1833fbe" alt=""><figcaption></figcaption></figure>

### 需要了解的函数

<table><thead><tr><th width="265"></th><th></th></tr></thead><tbody><tr><td>SendCharacterText</td><td>一个公共函数，用于发送一段文本以显示为角色转录内容，并附带说出该内容的角色名称。</td></tr><tr><td>SendUserText</td><td>一个公共函数，用于发送一段文本以显示为用户转录内容。</td></tr></tbody></table>


---

# 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/unity-plugin/utilities/convai-ui-prefabs.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.
