using TMPro; using UnityEngine; using UnityEngine.UI; public class DinoCountdownUI : MonoBehaviour { public TMP_Text countdownText; public Text countdownTextLegacy; public float hideDelay = 0.75f; float goTime = -1f; void Update() { DinoGameManager gm = DinoGameManager.Instance; if (gm == null) return; if (gm.IsGameStarted) { if (goTime < 0f) goTime = Time.time; if (Time.time - goTime > hideDelay) { SetText(""); return; } SetText("GO!"); return; } float remaining = gm.GetCountdownRemaining(); int sec = Mathf.CeilToInt(remaining); SetText(sec.ToString()); } void SetText(string value) { if (countdownText != null) countdownText.text = value; if (countdownTextLegacy != null) countdownTextLegacy.text = value; } }