> 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/conversation-availability.md).

# 对话可用性

查找用于检查某个 Convai 角色当前是否能听到玩家，以及在不能时如何在 UI 中响应的指南。

对话可用性是 Convai Unity SDK 判断玩家当前是否可以与角色交谈，以及无法交谈时原因何在的机制。房间已连接并不意味着目标角色能听到任何内容——服务必须先宣布该角色，并且 `ConvaiManager.ConversationAvailability` 是获取这一答案的唯一入口。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>了解各个状态、为什么仅连接房间还不够，以及可用性与角色就绪标志有何不同。</td><td><a href="https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/conversation-availability/how-availability-works.md">对话可用性如何运作</a></td></tr><tr><td><strong>根据可用性控制 UI</strong><br>将自定义聊天输入框、发送按钮或麦克风控件绑定到当前判定结果。</td><td><a href="https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/conversation-availability/gate-your-ui.md">根据可用性控制 UI</a></td></tr><tr><td><strong>自定义聊天输入框提示</strong><br>修改内置聊天输入框显示的所有状态提示，并调整其慢速连接提示。</td><td><a href="https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/conversation-availability/customise-chat-prompts.md">自定义聊天输入框提示</a></td></tr><tr><td><strong>响应玩家开始说话</strong><br>在 Convai 给出自己的确认判定之前，订阅本地麦克风和按住说话活动。</td><td><a href="https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/conversation-availability/local-player-activity.md">响应玩家开始说话</a></td></tr><tr><td><strong>对话可用性参考</strong><br>查阅控制玩家输入所涉及的所有状态、事件和方法。</td><td><a href="https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/conversation-availability/availability-reference.md">对话可用性参考</a></td></tr><tr><td><strong>排查玩家输入问题</strong><br>解决消息被拒、聊天输入框一直处于禁用状态或麦克风无法开启的问题。</td><td><a href="https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/conversation-availability/troubleshooting.md">玩家输入故障排查</a></td></tr></tbody></table>

### 可用性的来源

可用性并非整个房间通用的标志。它针对 `ConvaiManager.AddressedCharacter` 作出判断——也就是玩家当前正在交谈的角色。因此，同一个房间中，一个角色可能处于 `Ready` 状态，而另一个仍处于 `Preparing`状态。每个角色也都有自己的可用性，可通过 `ConvaiCharacter.ConversationAvailability`获取，适用于绑定到特定角色，而非当前目标角色的 UI。有关各状态背后的模型，请参阅 [对话可用性的工作原理](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/conversation-availability/how-availability-works.md) 。

### 后续步骤

请先阅读 [对话可用性的工作原理](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/conversation-availability/how-availability-works.md) 以了解各个状态，然后阅读 [根据可用性控制 UI](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/conversation-availability/gate-your-ui.md) 了解如何将自定义输入界面接入其中。

{% content-ref url="/pages/f76eaea2a343c7d72b93487d582ec00dd7ba1c58" %}
[多角色会话](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/multi-character-sessions.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/features/conversation-availability.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.
