> 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-beta-overview/getting-started/setup/add-chat-ui-transcript-ui.md). Agents can also search and read this documentation through its [MCP server](https://docs.convai.com/api-docs/~gitbook/mcp).

# 添加聊天 UI（转录 UI）

添加一个现成的聊天 UI 预制件，以启用文本输入和对话转录。

## 简介

聊天 UI 是可选的，但对于调试、无语音测试以及演示文本对话非常有用。

## 前提条件

* 已安装 Convai SDK
* 已完成 Convai 设置的场景

## 分步指南

{% stepper %}
{% step %}
**找到 Transcript UI 预制件**

* 在 Project 窗口的搜索栏中搜索：
  * `TranscriptUI_Chat`
* 确保搜索范围包含 **In Packages** 或 **All**.

<figure><img src="https://2402152281-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEtUJA212Zc1S9ACc8T4l%2Fuploads%2FkBMaQDWPmIS4ym6imj6R%2Fimage.png?alt=media&amp;token=7ffe41c1-e247-4471-95c6-07bac347d0ba" alt=""><figcaption></figcaption></figure>

* 或者，你也可以使用此软件包路径：
  * `Packages/com.convai.convai-sdk-for-unity/Prefabs/TranscriptUI/TranscriptUI_Chat.prefab`
    {% endstep %}

{% step %}
**将预制件添加到场景中**

* 将 **TranscriptUI\_Chat.prefab** 拖放到场景中。
* **预期结果：** UI 会显示在 Hierarchy 中，并在 Game 视图（播放模式）中可见。
  {% endstep %}

{% step %}
**确保场景中存在 Event System**

* 如果场景中没有 EventSystem：
  * 在 Hierarchy 中右键单击 → **UI → Event System**
* **预期结果：** 场景中存在 EventSystem，且 UI 输入在播放模式下可以正常工作。

<figure><img src="https://2402152281-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEtUJA212Zc1S9ACc8T4l%2Fuploads%2FXb2xG7zTe8RdLF8pkbg7%2Fimage.png?alt=media&amp;token=73a01256-cd0d-42e9-bc10-4253301eb12e" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

## 故障排查

* **UI 无法响应点击或键入操作**
  * 确认场景中恰好有一个 EventSystem。
* **未找到预制件**
  * 确认软件包已正确安装。
  * 确认 Project 窗口的搜索范围包含“In Packages”或“All”。

## 总结

你已将 Transcript UI 添加到场景中，现在可以输入文本并查看易读的对话记录。现在，你可以通过键盘或麦克风测试对话。

{% hint style="info" %}
**需要帮助？** 如有疑问，请访问 [**Convai 开发者论坛**](https://forum.convai.com/).
{% endhint %}


---

# 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/unity-plugin-beta-overview/getting-started/setup/add-chat-ui-transcript-ui.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.
