Files
Simulation/Assets/Scripts/UI/TextPopup.cs
SullyunShin c26d94636d
All checks were successful
Code Review / code-review (pull_request) Successful in 9s
UI 관련 스크립트 추가
2025-04-30 17:55:20 +09:00

27 lines
599 B
C#

using UnityEngine;
using TMPro;
using System.Collections;
public class TextPopup : UnitySingleton<TextPopup>
{
public GameObject uiObj;
public TMP_Text log;
public void Show(string text, float showTime)
{
log.text = text;
uiObj.SetActive(true);
StopAllCoroutines();
StartCoroutine(ShowTextCoroutine(showTime));
}
IEnumerator ShowTextCoroutine(float time)
{
while (time >= 0)
{
time -= Time.deltaTime;
yield return null;
}
uiObj.SetActive(false);
yield return null;
}
}