using System.Collections; using System.Collections.Generic; using TMPro; using UnityEngine; using XRTool.Util; public class DaoJiShi : MonoBehaviour { int Count = 30; Timer t; private void OnEnable() { if(TimerMgr.Instance) { TimerMgr.Instance.DestroyTimer(t); Count = 30; this.GetComponent().text = Count.ToString(); t = TimerMgr.Instance.CreateTimer(() => { Count--; this.GetComponent().text = Count.ToString(); }, 0.1f, 30); } } }