This commit is contained in:
j.mei7
2022-03-01 20:47:08 +01:00
parent 37f2c289bc
commit 7e0f3e6930
188 changed files with 218108 additions and 0 deletions

25
Assets/Scripts/TimeUI.cs Normal file
View File

@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using UnityEngine;
using TMPro;
public class TimeUI : MonoBehaviour
{
TextMeshProUGUI dateTimeText;
TimeManager timeManager;
private void Start()
{
timeManager = GameObject.Find("GameManager").GetComponent<TimeManager>();
TimeManager.OnTimeInterval += OnInterval;
dateTimeText = GetComponent<TextMeshProUGUI>();
}
void OnInterval()
{
DateTime dateTime = timeManager.GetDateTime();
if (dateTimeText != null)
dateTimeText.text = dateTime.ToString("hh:mm tt / dd.MM.yyyy", timeManager.cultureInfo);
}
}