Files
JourneyToNowhere_Unity/Assets/Scripts/SingleUtils/3DTimeText.cs
T
2024-01-27 08:49:55 +08:00

29 lines
597 B
C#
Executable File

using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
public class TimeText3D : MonoBehaviour
{
public TMP_Text TextObject;
void Update()
{
if (TextObject)
{
string Time = TimeController.PublicFormattedTimeOfDay;
TextObject.text = "In-game time: " + Time;
}
}
public void SetTimeFormat(bool is24hour)
{
TimeController.MilitaryTime = is24hour;
}
private void OnMouseDown()
{
SetTimeFormat(!TimeController.MilitaryTime);
}
}