Batch 1 - Scripts
This commit is contained in:
27
Assets/New Lowpoly Models/Scripts/CashPopupUI.cs
Normal file
27
Assets/New Lowpoly Models/Scripts/CashPopupUI.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user