1101 한글 타자기 에셋 사용법

null·2023년 11월 1일

Unity Study

목록 보기
33/60

https://assetstore.unity.com/packages/tools/localization/koreantyper-232949?clickref=1100lxV7xLI9&utm_source=partnerize&utm_medium=affiliate&utm_campaign=unity_affiliate

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); // 약간의 딜레이 주기
        }
    }
}




0개의 댓글