Stratasys-450mc-VR/Assets/Scripts/DigitalWatch.cs
Cody Wright b4656bf24a Fixed watch texture
added the missing watch texture and corrected the watch orientation
2024-01-09 15:38:27 -05:00

18 lines
463 B
C#

using UnityEngine;
using TMPro;
public class DigitalWatch : MonoBehaviour
{
public TextMeshProUGUI timeText;
void Start()
{
InvokeRepeating("UpdateTime", 0f, 1f); // Update time every second
}
void UpdateTime()
{
string currentTime = System.DateTime.Now.ToString("hh:mm tt"); // Get current time in the desired format
timeText.text = currentTime; // Update the TextMeshPro component with the current time
}
}