> 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-ko/effects/setting-up-texts.md).

# 텍스트 설정

Text Animator에 텍스트를 두 가지 서로 다른 UI 시스템에서 설정할 수 있습니다:

* [#ui-toolkit](#ui-toolkit "mention")
* [#text-mesh-pro](#text-mesh-pro "mention")

{% hint style="info" %}
이 페이지에는 이미 다음에 있는 정보의 일부가 포함되어 있습니다 [설치 및 빠른 시작](/text-animator-unity/3.x-ko/quick-start/install-and-quick-start.md), 하지만 각 시스템과 전반적인 내용에 대한 다른 세부 사항과 제안도 있습니다. 반드시 다음을 읽어보세요 [#best-practices](#best-practices "mention") 섹션!&#x20;
{% endhint %}

***

## UI 툴킷

{% hint style="success" %}
이제 끝입니다!! 다음을 사용할 준비가 되었습니다 [효과 추가 방법](/text-animator-unity/3.x-ko/effects/how-to-add-effects.md)
{% endhint %}

***

## Text Mesh Pro

{% hint style="success" %}
이제 끝입니다!! 다음을 사용할 준비가 되었습니다 [효과 추가 방법](/text-animator-unity/3.x-ko/effects/how-to-add-effects.md)
{% endhint %}

{% hint style="warning" %}
비어 있는 텍스트가 보인다면(하지만 컴포넌트에는 설정해 두었다면), TextMeshPro 컴포넌트를 최소 한 번은 클릭하고 "Essentials"를 가져왔는지 확인하세요(창이 나타나면 그렇게 하라고 요청할 것입니다).
{% endhint %}

#### 코드로 텍스트를 설정할 때의 모범 사례

코드로 TextMeshPro 오브젝트에 텍스트를 설정하려면, 다음과 같이 TMPro 대신 Text Animator의 스크립트를 참조하세요:

```csharp
using UnityEngine;
using TMPro; 
using Febucci.TextAnimatorForUnity.TextMeshPro; // <- Text Animator의 네임스페이스를 가져옵니다

public class ExampleScript : MonoBehaviour
{
    [SerializeField] TMP_Text textMeshPro;
    [SerializeField] TextAnimator_TMP textAnimator;

    void Start()
    {
        // 🚫 하지 마세요: TMPro를 통해 텍스트를 설정
        textMeshPro.SetText("<wave>hello");

        // ✅ 하세요: Text Animator를 통해 직접 텍스트를 설정
        textAnimator.SetText("<wave>hello");
    }

}
```

{% hint style="info" %}
참고: TMPro를 참조해도 어쨌든 동작하지만, TextAnimator로 텍스트를 설정하는 편이 텍스트를 더 잘 제어할 수 있어 통합이 더 좋습니다.
{% endhint %}

***

## 모범 사례

### 전체 텍스트/대사를 한 번만 설정하세요

텍스트는 한 번만 설정하고, 타자기/표시 방법으로 어떻게 나타날지 제어해 보세요.

{% hint style="info" %}
정말 나중에 텍스트를 덧붙여야 한다면 "textAnimator.AppendText" 메서드를 사용할 수 있습니다.
{% endhint %}

<details>

<summary>예시</summary>

캐릭터가 "Helloooo how are you doing?"라고 말하고 있고, 이를 글자 하나씩 표시하고 싶다면, 다음과 같이 하면 됩니다: `typewriter.ShowText("Hellooooo how are you doing?");` 이게 전부입니다! [글자를 동적으로 표시하고 숨기기](/text-animator-unity/3.x-ko/typewriter/show-and-hide-letters-dynamically.md)

***

동적 문자열을 만들고 있다면, 타자기/애니메이터에 값을 설정하기 전에 여전히 그렇게 할 수 있습니다.

```csharp
int apples = 5; //later taken from the game state
string playerName = "Bob";

// 먼저 전체 대사 줄을 만듭니다
string dialogue = $"Hello {playerName}, you've got {apples} apples";

// 그런 다음 텍스트를 한 번만 설정합니다
typewriter.ShowText(dialogue);
```

(Dialogue System을 사용 중이라면, 그 시스템이 이 작업을 대신해 줄 것입니다 - 걱정 마세요 ! [통합](/text-animator-unity/3.x-ko/integrations/integrated-plugins-and-dialogues-systems.md))

</details>

<details>

<summary>왜 문자를 하나씩이 아니라 전체 텍스트를 한 번만 설정해야 하나요?</summary>

성능 때문입니다! (Text Animator가 없더라도 마찬가지입니다.)

텍스트를 설정할 때마다 TextMeshPro 또는 UI 툴킷은 메시, 위치 지정 등을 계산해야 하고, 이후 Text Animator도 문자 지속 시간 등 여러 가지를 다시 계산해야 합니다. 즉, 이를 초당 여러 번 변경한다면(예: 글자를 더 추가한다면), 매번 이러한 계산을 수행하게 됩니다.

문자를 하나씩 표시하려면, 전체 텍스트를 한 번만 설정한 다음 타자기를 시작하면 됩니다: [글자를 동적으로 표시하고 숨기기](/text-animator-unity/3.x-ko/typewriter/show-and-hide-letters-dynamically.md)&#x20;

</details>


---

# 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:

```
GET https://docs.febucci.com/text-animator-unity/3.x-ko/effects/setting-up-texts.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.
