using System.Collections; using System.Collections.Generic; using UnityEngine; [RequireComponent(typeof(TMPro.TextMeshProUGUI))] public class TimerText : MonoBehaviour { private vTimerCounter _timer; private TMPro.TextMeshProUGUI _text; private void Awake() { _timer = FindObjectOfType(); _text = GetComponent(); } private void OnEnable() { _timer.OnUpdateTimer += UpdateText; } private void OnDisable() { _timer.OnUpdateTimer -= UpdateText; } private void UpdateText(string text) { _text.SetText(text); } }