1234567891011121314151617181920212223242526 |
- 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<TextMeshProUGUI>().text = Count.ToString();
- t = TimerMgr.Instance.CreateTimer(() => {
- Count--;
- this.GetComponent<TextMeshProUGUI>().text = Count.ToString();
- }, 0.1f, 30);
- }
- }
- }
|