> 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/typewriter/show-and-hide-letters-dynamically.md).

# 글자를 동적으로 표시하고 숨기기

<mark style="color:기본값;background-color:yellow;">**타이프라이터를 사용하면 글자를 동적으로 표시하고 숨길 수 있습니다**</mark><mark style="color:기본값;background-color:yellow;">,</mark> 문자 종류(구두점, 글자, \[…] 등)에 따라 서로 다른 일시정지를 선택하고, 이벤트를 트리거하는 등.

***

## 텍스트 표시 <a href="#showing-text" id="showing-text"></a>

그 타이프라이터에는 일반 설정과 이벤트 리스너가 포함되어 있으며, 다양한 일시정지/타이밍 모드를 사용할 수 있습니다:

* **문자 단위로**: 한 글자씩 차례로 표시합니다.
* **단어 단위로**: 텍스트를 단어 단위로 진행합니다.

{% hint style="success" %}
이 새로운 구조(3.0부터)는 이벤트 참조와 설정은 그대로 유지한 채, 개발 중에 어떤 이유로든 타이프라이터의 타이밍을 변경할 수 있게 해줍니다! <3
{% endhint %}

**타이프라이터는 다음과 같이 보여야 합니다:**

{% tabs %}
{% tab title="Text Mesh Pro" %}
인스펙터의 TypewriterComponent에서:

<figure><img src="/files/ce75644b7dbb2976795578f5b8cc31637efbdb7f" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="UI Toolkit" %}
UI Builder의 AnimatedLabel에서:

<figure><img src="/files/c087d5db6246a625959facdce10a26fff715efce" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}

{% hint style="warning" %}
timings ScriptableObject를 반드시 할당하세요. 그렇지 않으면 타이프라이터가 전체 텍스트를 즉시 표시합니다!
{% endhint %}

***

타이프라이터를 시작하는 방법은 크게 두 가지입니다:

### A) 코드로 (권장) <a href="#a-via-code-recommended" id="a-via-code-recommended"></a>

타이프라이터를 사용하려면, **코드를 통해 해당 컴포넌트에 텍스트를 직접 설정하는 것이 권장됩니다.**

{% tabs %}
{% tab title="Text Mesh Pro" %}
TextMeshPro를 사용 중이라면, TMPro 또는 Text Animator를 참조하는 스크립트([텍스트 설정](/text-animator-unity/3.x-ko/effects/setting-up-texts.md))를 교체하고 `Febucci.TextAnimatorForUnity.TypewriterComponent`  를 대신 참조하세요.

* :x: 하지 마세요: “`tmproText.text = textValue;`” , 또는 "`textAnimator.SetText(textValue);`"&#x20;
* :white\_check\_mark: 하세요:  `typewriter.ShowText(textValue);`
  {% endtab %}

{% tab title="UI Toolkit" %}
UI Toolkit을 통해서는 `AnimatedLabel` 이미 "`Typewriter`" 값을 사용할 수 있습니다!\
타이프라이터 지연 시간을 할당했는지만 확인하면, 다른 작업은 필요 없습니다.
{% endtab %}
{% endtabs %}

### B) 자동 인식 <a href="#b-via-the-easy-integration" id="b-via-the-easy-integration"></a>

위 단계를 따르지 않았더라도, Typewriter 컴포넌트를 추가했거나 UI Toolkit의 AnimatedLabel을 통해 "Timings"를 설정했다면 TextAnimator는 여전히 타이프라이터를 자동으로 시작하려고 시도합니다.&#x20;

{% hint style="warning" %}
Easy Integration은 한 프레임 늦게 적용될 수 있습니다(먼저 무언가가 변경되었음을 감지해야 하는데, 보통 이는 이전 프레임에 이미 처리되어 있고, 그다음 타이프라이터를 시작하기 때문입니다). 이것이 문제가 된다면, 해당 단계를 따르거나 [글자를 동적으로 표시하고 숨기기](/text-animator-unity/3.x-ko/typewriter/show-and-hide-letters-dynamically.md#a-via-code-recommended), 또는 다음을 참고하세요 [문제 해결](/text-animator-unity/3.x-ko/other/troubleshooting.md#when-i-set-the-text-i-see-the-previous-one-for-one-frame-before-showing-the-new-one)
{% endhint %}

***

## 문자 제어

### 타이핑 시작 및 중지 <a href="#start-and-stop-typing" id="start-and-stop-typing"></a>

컴포넌트의 인스펙터에서 타이프라이터 시작이 어떻게 트리거될지 제어하는 몇 가지 옵션을 찾을 수 있습니다:

* `타이프라이터 시작 모드`: 타이프라이터가 언제 글자 표시를 시작할지 알려줍니다.

<table><thead><tr><th width="300">값</th><th>설명</th></tr></thead><tbody><tr><td><strong>스크립트에서만</strong></td><td>타이프라이터는 다음을 호출해서만 시작할 수 있습니다 <a href="https://www.api.febucci.com/tools/text-animator-unity/api/Febucci.UI.Core.TypewriterCore.html#Febucci_UI_Core_TypewriterCore_ShowText_System_String_">TextAnimatorPlayer.StartShowingText()</a></td></tr><tr><td><strong>OnEnable</strong></td><td>gameObject가 활성화될 때마다 타이프라이터가 시작됩니다</td></tr><tr><td><strong>OnShowText</strong></td><td>새 텍스트가 설정되자마자 타이프라이터가 시작됩니다 (<a href="#showing-text">“Showing Text” 섹션에서 설명한 대로</a>)</td></tr><tr><td><strong>모든 이벤트에서 자동으로</strong></td><td>위의 모든 항목</td></tr></tbody></table>

* `시작 시 타이핑 속도 재설정`: 새 텍스트가 표시될 때마다 타이프라이터 속도를 1로 다시 재설정하고 싶다면 true로 설정하세요. 그렇지 않으면 마지막으로 사용한 값을 유지합니다.

{% hint style="success" %}
다음을 호출하면 언제든지 타이프라이터를 일시정지할 수 있습니다 `typewriter.StopShowingText()`, 그리고 다음을 호출하여 시작/재개할 수 있습니다 `typewriter.StartShowingText()`.
{% endhint %}

### 전체 텍스트 건너뛰기 <a href="#skip" id="skip"></a>

전체 타이프라이터를 건너뛰려면 다음을 호출하면 됩니다 `typewriter.SkipTypewriter()` 메서드.

동작 방식을 제어하는 몇 가지 옵션도 있습니다:

* `건너뛰기 시 등장 효과 숨기기`: 타이프라이터를 건너뛸 때마다 등장 효과가 재생되지 않게 하려면 true로 설정하세요(즉, 텍스트가 즉시 표시됩니다).
* `건너뛰기 시 이벤트 트리거`: 타이프라이터를 건너뛸 때 남아 있는 모든 이벤트를 한꺼번에 트리거하고 싶다면 true로 설정하세요(이벤트에 게임 로직이 연결되어 있다면 한 번에 모두 실행되므로 주의하세요). 이벤트에 대한 자세한 내용은 여기에서 확인하세요: [입력 중 이벤트 트리거](/text-animator-unity/3.x-ko/typewriter/trigger-events-when-typing.md)

### 텍스트의 특정 부분 건너뛰기

{% hint style="warning" %}
이 기능은 3.0에서 테스트 중이며, 다음 버전에서 곧 복원될 예정입니다! 양해해 주셔서 감사합니다!
{% endhint %}

### 텍스트 숨기기 <a href="#hiding-text" id="hiding-text"></a>

다음을 호출하여 스크립트로 글자를 동적으로 숨길 수 있습니다 `typewriter.StartDisappearingText()`, 그리고 다음을 호출하여 언제든지 중지할 수도 있습니다 `typewriter.StopDisappearingText()`.

***

{% hint style="info" %}
직접 타이밍 대기 시간을 만들 수 있습니다(다음을 읽어보세요 [여기 ](/text-animator-unity/3.x-ko/writing-custom-classes/c-1.md)C#으로 만드는 방법) 또는 내장된 기능을 사용할 수 있습니다.
{% endhint %}

## 옵션 <a href="#options" id="options"></a>

타이프라이터는 같은 설정을 공유할 수도 있고 개별 설정도 가질 수 있으므로, 인스펙터에서 각 필드 위에 마우스 커서를 올려 툴팁을 확인하세요.

가장 중요하고 흔한 항목들을 간단히 살펴보면:

### 콜백(Unity 이벤트) <a href="#callbacks-unity-events" id="callbacks-unity-events"></a>

타이프라이터 동작에 따라 트리거되는 Unity 이벤트를 사용할 수 있습니다(예: 텍스트 표시가 막 끝났을 때).

<figure><img src="/files/6eaefeae41b85173987c19e2b5888f1e7c4c7913" alt=""><figcaption></figcaption></figure>

<table><thead><tr><th width="288">이벤트</th><th>설명</th></tr></thead><tbody><tr><td><code>OnTextShowed</code></td><td>전체 텍스트가 표시된 후 호출되는 이벤트(<em>“Use Typewriter”를 true로 설정했다면, 모든 글자가 표시될 때까지 기다립니다</em>)</td></tr><tr><td><code>OnTextDisappeared</code></td><td>스크립트가 마지막 글자를 숨기기 시작하자마자 호출됩니다</td></tr></tbody></table>

아래 항목들은 “**use typewriter**”가 **true**:

<table><thead><tr><th width="288">이벤트</th><th>설명</th></tr></thead><tbody><tr><td><code>OnTypewriterStart</code></td><td>타이프라이터가 첫 글자를 표시하기 직전에 호출됩니다.<br>타이프라이터가 꺼져 있으면 “OnTextShowed” 이벤트와 겹치므로 작동하지 않습니다 <em>(이 경우에는 대신 그 이벤트를 사용할 수 있습니다)</em></td></tr><tr><td><code>OnCharacterVisible(Char)</code></td><td>문자가 보일 때마다 호출됩니다</td></tr><tr><td><code>OnMessage(EventMarker)</code></td><td>타이프라이터가 텍스트에서 메시지/이벤트를 만날 때마다 호출됩니다. 이벤트에 대해 더 읽어보기 <a href="/pages/62c42e116613b44ade473b34c0da6874cfbce04a">여기</a></td></tr></tbody></table>

{% hint style="info" %}
타이프라이터는 연결된 Text Animator를 사용하여 **시간 배율** 시간을 진행합니다(자세한 내용은 여기에서 확인할 수 있습니다: [애니메이터 설정](/text-animator-unity/3.x-ko/effects/how-to-add-effects/animator-settings.md#time-scale)), 즉 시간이 "Unscaled"로 설정되면 게임이 일시정지되어도 타이프라이터는 계속 진행됩니다.
{% 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:

```
GET https://docs.febucci.com/text-animator-unity/3.x-ko/typewriter/show-and-hide-letters-dynamically.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.
