27 lines
538 B
C#
27 lines
538 B
C#
using TMPro;
|
|
using UnityEngine;
|
|
using System.Collections;
|
|
|
|
public class CashPopupUI : MonoBehaviour
|
|
{
|
|
[SerializeField] private TextMeshProUGUI amountText;
|
|
|
|
public void Show(int amount)
|
|
{
|
|
amountText.text = $"+${amount:N0}";
|
|
|
|
AudioManager.Instance?.PlaySFX("CashPopup");
|
|
|
|
gameObject.SetActive(true);
|
|
|
|
StopAllCoroutines();
|
|
StartCoroutine(HideRoutine());
|
|
}
|
|
|
|
IEnumerator HideRoutine()
|
|
{
|
|
yield return new WaitForSeconds(1.5f);
|
|
|
|
gameObject.SetActive(false);
|
|
}
|
|
} |