using System.Collections; using UnityEngine; public class UniStormTest : MonoBehaviour { public float changeTimeSpeed = 1f; private UniStormWeatherSystem_C uniStormSystem; private void Awake() { uniStormSystem = base.gameObject.GetComponent(); } private void Start() { StartCoroutine(ChangeTime()); } private void Update() { } public IEnumerator ChangeTime() { while (true) { yield return new WaitForSeconds(changeTimeSpeed); if (uniStormSystem.startTime == 23f) { uniStormSystem.startTime = 0f; } else { uniStormSystem.startTime += 1f; } } } }