> 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/3.x-zh/ji-cheng/yi-ji-cheng-de-cha-jian-yu-dui-hua-xi-tong/unity-dui-hua-xi-tong.md).

# Unity 对话系统

Unity 的 Dialogue System 是一个用于 Unity 的分支对话系统。它无需脚本即可使用，但设计上易于程序员扩展，已被用于《Disco Elysium》、《Yes Your Grace Snowfall》等多款游戏。

<a href="https://prf.hn/l/7JOjQmj/" class="button primary">获取 Unity 的 Dialogue System</a> *（推广链接）*

***

## 集成步骤

{% hint style="info" %}
我们已在 Dialogue System for Unity 版本下测试过 Text Animator 3.X **2.2.64.1**

它应适用于 Dialogue System 2.X 的所有版本，但如果你发现引入了某些破坏性更改——请告知我们！
{% endhint %}

所有集成步骤同时写在此处和 PixelCrushers 的文档中。

{% embed url="<https://www.pixelcrushers.com/dialogue_system/manual2x/html/text_animator.html>" %}

你可以通过一个 [简短视频](#video-guide) 或通过 [文字指南](#text-guide) 来学习，详见下文。

### 视频指南

{% embed url="<https://3857371675-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXuXUTa2X5PYuYL6yRvl1%2Fuploads%2Fff258LTw3nvqQgNfDjpp%2FTutorial%20Integration%20Dialogue%20System%20with%20Text%20Animator%203.mp4?alt=media&token=bd08b49b-1550-4996-942f-fe7be8f1aeaa>" %}

### 文字指南

{% stepper %}
{% step %}

#### 项目设置

**步骤 1。** 确保在 Dialogue System for Unity 中启用了 TextMeshPro

<figure><img src="/files/9c4714a01062f4111b7ec2c7005fcefa05547705" alt=""><figcaption></figcaption></figure>

*（Text Animator 使用 TMPro 或 UI Toolkit，因此你可以选择最喜欢的一个，两个的设置类似）*

**步骤 2。** 从 Dialogue System -> Third Party support 导入 “Text Animator V3” 支持包。

<figure><img src="/files/63843ff3e7a5041c6a23fb9479a5098a59d61341" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### 文本设置

对于你想要为其添加动画的对话预制件中的每个文本元素（例如 NPC 字幕）：

* 确保基础文本组件为 `TextMeshPro` （并确保在 UI 面板中重新链接任何断开的引用）。<br>

  <figure><img src="/files/6ae982a5549844ff6231abd263fa79e92c4d7a35" alt=""><figcaption></figcaption></figure>
* 添加一个 `Text Animator` 组件到相同的文本游戏对象上。
* 另外添加一个 `Typewriter` 组件（如果你想使用打字机效果）。
  {% endstep %}

{% step %}

#### 替换标准 UI 字幕面板&#x20;

将 `标准 UI 字幕面板` 替换为 `Text Animator 字幕面板` 并确保所有引用都是最新的。&#x20;

<figure><img src="/files/4b079b334b3a04b7182f55cb323391dc2179559f" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
与其手动删除并重新添加组件（这可能会破坏现有引用），你可以使用检查器右上角的调试模式（顶点的点）更轻松地替换脚本。

![](/files/ab965c961bd1d1c2eae812c69eb7580b6ff92427)
{% endhint %}
{% endstep %}

{% step %}

#### 替换继续按钮

将 `将标准 UI 继续按钮` 替换为专为 `Text Animator` 由 PixelCrushers 设计、称为 `Text Animator Continue Button 快速前进`.

还要确保在检查器中正确链接了 Typewriter 组件。

<figure><img src="/files/ea92ce98a490c7bc6ac555d03524d5eaaf89ef6a" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

***

尽情享用！查看 [如何添加效果](/text-animator-unity/3.x-zh/xiao-guo/ru-he-tian-jia-xiao-guo.md) 和 [动态显示和隐藏字母](/text-animator-unity/3.x-zh/da-zi-ji/dong-tai-xian-shi-he-yin-cang-zi-mu.md) 以快速开始为你的对话添加更多效果。

{% hint style="info" %}
请让我们知道它是否按您预期的方式工作，或者您是否希望添加任何新功能或改进！干杯！
{% endhint %}
