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:
21
Assets/Scripts/UI/TimeUI.cs
Normal file
21
Assets/Scripts/UI/TimeUI.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using TMPro;
|
||||
|
||||
public class TimeUI : MonoBehaviour
|
||||
{
|
||||
TextMeshProUGUI dateTimeText;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
TimeManager.OnTimeUpdate += OnTimeUpdate;
|
||||
dateTimeText = GetComponent<TextMeshProUGUI>();
|
||||
}
|
||||
|
||||
void OnTimeUpdate()
|
||||
{
|
||||
DateTime dateTime = TimeManager.instance.GetDateTime();
|
||||
if (dateTimeText != null)
|
||||
dateTimeText.text = dateTime.ToString("hh:mm tt / dd.MM.yyyy", TimeManager.instance.cultureInfo);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user