using UnityEngine; public class ColorDayTime : MonoBehaviour { public Gradient timeColor = new Gradient(); public Gradient timeColorWinter = new Gradient(); private Material material; private WeatherLevelManager weatherLevelManager; private bool isIceLevel; private void Start() { material = GetComponent().sharedMaterial; weatherLevelManager = GameController.Instance.weatherLevelManager; isIceLevel = GameController.Instance.iceLevel; } private void LateUpdate() { if (isIceLevel) { material.color = timeColorWinter.Evaluate(weatherLevelManager.GetFullTime() / 24f); } else { material.color = timeColor.Evaluate(weatherLevelManager.GetFullTime() / 24f); } } }