1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class UpdateManager : MonoBehaviour
- {
- public float time = 60;
- public float timea = 5;
-
- void Start()
- {
- StartCoroutine(updateTime());
- StartCoroutine(playAnimation());
- }
- IEnumerator updateTime()
- {
- while(true)
- {
- updateData();
- yield return new WaitForSeconds(time);
- }
- }
- IEnumerator playAnimation()
- {
- while(true)
- {
- updateAnimation();
- yield return new WaitForSeconds(timea);
- }
- }
- public virtual void updateData()
- {
- }
- public virtual void updateAnimation()
- {
- }
- }
|