2026-06-19 UI, UI로직

This commit is contained in:
skrwns304@gmail.com
2026-06-19 14:27:40 +09:00
parent b751a9ed66
commit b1e85a5b89
549 changed files with 18058 additions and 20 deletions

View File

@@ -0,0 +1,63 @@
using System.Collections;
using TMPro;
using UnityEngine;
public class MemoryProgressPopupUI : MonoBehaviour
{
[Header("Panel")]
[SerializeField] private GameObject popupPanel;
[Header("Text")]
[SerializeField] private TMP_Text titleText;
[SerializeField] private TMP_Text countText;
[Header("Settings")]
[SerializeField] private string message = "기억의 조각을 얻었다!";
[SerializeField] private float showTime = 1.5f;
private Coroutine popupRoutine;
private void Awake()
{
HidePopup();
}
public void ShowPopup(int current, int max)
{
if (popupRoutine != null)
StopCoroutine(popupRoutine);
popupRoutine = StartCoroutine(PopupRoutine(current, max));
}
public void HidePopup()
{
if (popupRoutine != null)
{
StopCoroutine(popupRoutine);
popupRoutine = null;
}
if (popupPanel != null)
popupPanel.SetActive(false);
}
private IEnumerator PopupRoutine(int current, int max)
{
if (popupPanel != null)
popupPanel.SetActive(true);
if (titleText != null)
titleText.text = message;
if (countText != null)
countText.text = $"{current} / {max}";
yield return new WaitForSeconds(showTime);
if (popupPanel != null)
popupPanel.SetActive(false);
popupRoutine = null;
}
}