计时器

  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using System.Threading;
  4. using UnityEngine;
  5. public class Async : MonoBehaviour
  6. {
  7. // Start is called before the first frame update
  8. void Start()
  9. {
  10. //创建定时器
  11. Timer timer = new Timer(TimeOut, null, 5000, 0);
  12. }
  13. // Update is called once per frame
  14. private void TimeOut(System.Object state)
  15. {
  16. Debug.Log("sfas");
  17. }
  18. }