mirror of
				https://github.com/DerTyp7/grow-ai-unity.git
				synced 2025-10-31 05:17:08 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			21 lines
		
	
	
		
			509 B
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			21 lines
		
	
	
		
			509 B
		
	
	
	
		
			C#
		
	
	
	
	
	
| 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);
 | |
|     }
 | |
| } | 
