Exemple #1
0
 IEnumerator TransitionRoutine(LightSettings newSettings)
 {
     for (float t = 0f; t < transitionTime; t += Time.deltaTime)
     {
         //light.colorTemperature = Mathf.Lerp(light.colorTemperature, newSettings.colorTemperature, t / lerpTime);
         light.color     = Color.Lerp(light.color, newSettings.color, t / transitionTime);
         light.intensity = Mathf.Lerp(light.intensity, newSettings.intensity, t / transitionTime);
         yield return(null);
     }
 }
Exemple #2
0
 public void Transition(LightSettings newSettings)
 {
     StartCoroutine(TransitionRoutine(newSettings));
 }