> For the complete documentation index, see [llms.txt](https://docs.febucci.com/text-animator-unity/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.febucci.com/text-animator-unity/2.x-zh/typewriter/zai-da-zi-shi-deng-dai-dong-zuo.md).

# 在打字时等待动作

当打字机到达文本中的特定位置时，您可以执行动作。 *（因此，只有在启用打字机时动作才有效）*

示例：等待 X 秒或等待玩家输入。

***

## 如何在文本中添加动作 <a href="#how-to-add-actions-in-your-text" id="how-to-add-actions-in-your-text"></a>

您可以使用富文本标签将动作添加到文本中。

动作的格式遵循此公式：“`<actionID>`” 或 “`<actionID=attribute1,attribute2,...>`” 用于可选参数/属性（就像事件/消息一样）。

{% hint style="warning" %}
动作标签不区分大小写， `<waitfor>` 以及 `<waitFor>` 将产生相同的结果。
{% endhint %}

#### 参数 <a href="#parameters" id="parameters"></a>

动作支持多个参数，在 “`=`” 符号之后，并由 `逗号`.

分隔 示例： `<waitfor=1.5>` 或 `<playaudio=tada,laugh,dub>`

* ⚠️ 浮点数必须使用 `句点`，而不是 `逗号`.
  * ✔️ \<speed=0.5>
  * ❌ \<speed=0,5>

***

## 数据库 <a href="#databases" id="databases"></a>

与效果类似，您会在其数据库中找到动作。您可以根据需要添加和删除任意数量，创建特定动作并且还可以 [通过 C# 编写您自己的动作](/text-animator-unity/2.x-zh/tong-guo-c-jin-xingewai-zi-ding-yi/bian-xie-zi-ding-yi-dong-zuo-c.md).

## 内置动作 <a href="#built-in-actions" id="built-in-actions"></a>

您可以在文本中使用以下内置动作。

<table data-view="cards"><thead><tr><th></th><th data-hidden></th><th data-hidden></th></tr></thead><tbody><tr><td><p><strong>等待秒数</strong></p><ul><li>标签： waitfor</li><li>说明：在继续显示文本之前等待 X 秒。</li><li>属性：浮点数（等待时长）</li><li>使用示例： waitfor=1.5</li></ul></td><td><p></p><p></p></td><td></td></tr><tr><td><p><strong>等待输入</strong></p><ul><li>标签： waitinput</li><li>说明：等待玩家输入"</li><li>使用示例： waitinput</li></ul></td><td><p></p><p></p></td><td></td></tr><tr><td><p><strong>速度</strong></p><ul><li>标签： speed</li><li>说明： <em>乘以</em> 打字机速度</li><li>属性：浮点数（速度倍数）</li><li>使用示例： speed=2</li></ul></td><td></td><td></td></tr></tbody></table>

{% hint style="info" %}
请记住，您也可以通过使用 "\<notype>" 标签在文本的特定部分跳过打字效果，更多信息请阅读： [动态显示和隐藏字母](/text-animator-unity/2.x-zh/typewriter/dong-tai-xian-shi-he-yin-cang-zi-mu.md#skip-specific-parts-of-the-text)
{% endhint %}
