# 播放

<mark style="color:默认;background-color:yellow;">**播放方式决定效果如何随时间应用**</mark> （例如，仅播放一次效果）。

### 内置播放方式

您可以使用以下内置播放方式来修改您的效果，或者 [从检查器分配它们](/text-animator-unity/3.x-zh/xiao-guo/ru-he-bian-ji-xiao-guo.md) 或将它们设置为 [修饰符关键字：](/text-animator-unity/3.x-zh/xiao-guo/ru-he-bian-ji-xiao-guo/xiu-shi-fu.md#keywords)

例如，如果您已经有一个无限循环的“wave”效果，但在某种情况下您只想显示一次，您可以写“\<wave **一次**>”，其中“once”是该播放方式的 ID。

### 创建自定义播放方式

目前有三种不同类型的播放类可以实例化：

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

每种播放方式都有不同的参数可供修改（例如持续时间）。

{% hint style="success" %}
如果任何参数小于或等于 0，则该参数将被忽略，动画引擎将跳到“下一个”重要/相关参数。
{% endhint %}

{% hint style="warning" %}
出现和消失至少需要一个值大于 0，否则它们的持续时间将无效并被跳过
{% endhint %}

#### 简单

| 参数      | 描述                |
| ------- | ----------------- |
| 开始前延迟   | 动画引擎在开始显示效果前等待的时间 |
| 淡入/淡出时长 | 效果从 0 到 1 所需的时间   |
| 静止时长    | 效果在屏幕上显示的时间。      |

#### 加权

| 参数   | 描述                                   |
| ---- | ------------------------------------ |
| 强度01 | 允许您从外部控制效果应有的强度（例如靠近游戏目标时为 1，太远时为 0） |

#### 循环

<table data-full-width="false"><thead><tr><th>参数</th><th>描述</th></tr></thead><tbody><tr><td>开始前延迟</td><td>动画引擎在开始显示效果前等待的时间</td></tr><tr><td>淡入时长</td><td>效果从 0 到 1 所需的时间</td></tr><tr><td>静止时长</td><td>效果在屏幕上显示的时间。</td></tr><tr><td>淡出时长</td><td>效果从 1 到 0 所需的时间</td></tr><tr><td>循环次数</td><td>此循环重复的次数</td></tr><tr><td>循环间延迟</td><td>开始新循环前要等待的时间</td></tr></tbody></table>

***

### 播放方式数据库

像往常一样，您可以将播放方式存储在一个 **数据库** 并将其分配给 [全局设置](/text-animator-unity/3.x-zh/zi-ding-yi/quan-ju-she-zhi.md) （顺便说一下，已经有一个内置并已设置），例如如下：

<figure><img src="/files/5fa4a7b4af92454e97bc855382a09b00f61812df" alt=""><figcaption></figcaption></figure>

这样您就可以从所有不同的文本动画组件访问所有播放方式，并通过单独修改来调整您的效果 [修饰符](/text-animator-unity/3.x-zh/xiao-guo/ru-he-bian-ji-xiao-guo/xiu-shi-fu.md) （例如“`<wave once>`".

{% hint style="info" %}
如果您正在创建新的播放方式，请确保将其存储在该主/全局数据库中
{% endhint %}


---

# Agent Instructions: 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.febucci.com/text-animator-unity/3.x-zh/xiao-guo/ru-he-bian-ji-xiao-guo/bo-fang.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.
