using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using KoreanTyper; // 한글 타자기 활성화
public class KoreanTyperTest : MonoBehaviour
{
private string targetText;
private Text myText;
private void Awake()
{
myText = GetComponent<Text>();
}
void Start()
{
targetText = myText.text;
myText.text = "";
StartCoroutine(TypingRoutine());
}
IEnumerator TypingRoutine()
{ // 타이핑 길이 가져오기
int typingLength = targetText.GetTypingLength();
for (int index = 0; index <= typingLength; index++)
{
myText.text = targetText.Typing(index); // 타이핑 함수 적용
yield return new WaitForSeconds(0.05f); // 약간의 딜레이 주기
}
}
}