using TMPro; using UnityEngine; using UnityEngine.UI; public class DinoMatchUI : MonoBehaviour { public TMP_Text roundText; public TMP_Text stateText; public Text roundTextLegacy; public Text stateTextLegacy; public float updateInterval = 0.2f; float nextUpdate; void Update() { if (Time.time < nextUpdate) return; nextUpdate = Time.time + updateInterval; DinoGameManager gm = DinoGameManager.Instance; if (gm == null) return; SetText(roundText, roundTextLegacy, $"Round: {gm.CurrentRound}/{gm.maxRounds}"); string state; if (gm.IsMatchOver) state = "Match Over"; else if (gm.IsGameOver) state = "Round Over"; else if (!gm.IsGameStarted) state = "Ready"; else state = "Playing"; SetText(stateText, stateTextLegacy, state); } void SetText(TMP_Text tmp, Text legacy, string value) { if (tmp != null) tmp.text = value; if (legacy != null) legacy.text = value; } }