> 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/xiao-guo/wei-ni-de-wen-ben-tian-jia-xiao-guo/yang-shi.md).

# 样式

**样式可以快速将文本的某些部分替换为其他内容**，例如用于创建效果组合、打字机动作和事件，否则这些场景会需要你为重复标签大量输入。

{% hint style="danger" %}
如果你使用的是 TMPro，请为此使用 Text Animator Styles 而不是 TMPro 的样式，因为后者（TMPro 的）无法识别 Text Animator 标签，且会导致这些标签被添加到文本中。
{% endhint %}

***

只需打开你选择的样式表可序列化对象（你可以在项目文件夹中通过 Create 菜单 -> Text Animator -> StyleSheet 创建一个），可以为特定的 Text Animator 组件设置，也可以为所有组件全局设置（在设置中添加，如下图所示）

![](/files/718917e96a5e94fa61842d15356c51126f79b235)

然后你可以添加任意数量的样式，每个样式将包含样式标签、开启文本和关闭文本。

![](/files/eba3871b4392932e6e1a230f363c98c240a85205)

根据上面的示例，每当你在文本中写入样式标签“`<style1>`”时，它将被替换为“`<wave><play=5><rainb><shake>`”——并使用“`</style1>`”来关闭时，它将被替换为“`</wave></rainb></shake><?ended>`”。

{% hint style="info" %}
样式标签不区分大小写（写作 "\<style1>" 与 "\<Style1>" 会产生相同的结果）。
{% 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.febucci.com/text-animator-unity/2.x-zh/xiao-guo/wei-ni-de-wen-ben-tian-jia-xiao-guo/yang-shi.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
