UpdateManager.cs 486 B

12345678910111213141516171819202122232425262728
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class UpdateManager : MonoBehaviour
  5. {
  6. public float time = 60;
  7. // Start is called before the first frame update
  8. void Start()
  9. {
  10. StartCoroutine(updateTime());
  11. }
  12. IEnumerator updateTime()
  13. {
  14. while(true)
  15. {
  16. updateData();
  17. yield return new WaitForSeconds(time);
  18. }
  19. }
  20. public virtual void updateData()
  21. {
  22. }
  23. }