mirror of
https://github.com/DerTyp7/grow-ai-unity.git
synced 2026-07-31 16:19:03 +02:00
money UI
This commit is contained in:
19
Assets/Scripts/UI/MoneyUI.cs
Normal file
19
Assets/Scripts/UI/MoneyUI.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using UnityEngine;
|
||||
using TMPro;
|
||||
|
||||
public class MoneyUI : MonoBehaviour
|
||||
{
|
||||
TextMeshProUGUI moneyText;
|
||||
|
||||
void Start()
|
||||
{
|
||||
TimeManager.OnTimeUpdate += OnTimeUpdate;
|
||||
moneyText = GetComponent<TextMeshProUGUI>();
|
||||
}
|
||||
|
||||
void OnTimeUpdate()
|
||||
{
|
||||
if (moneyText != null)
|
||||
moneyText.text = EconomyManager.instance.GetMoneyStr();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user