diff options
| author | chai <215380520@qq.com> | 2024-05-20 22:36:58 +0800 |
|---|---|---|
| committer | chai <215380520@qq.com> | 2024-05-20 22:36:58 +0800 |
| commit | a22c505984697881f5f911a165ee022087b69e09 (patch) | |
| tree | d3c030aef1ae9b8a01c889dd2902bb1e3324e72b /Thronefall_1_0/Decompile/DaytimeSensitiveLight.cs | |
| parent | 4a4cc82d069b26bc4d4532e73860f86b211ca239 (diff) | |
Diffstat (limited to 'Thronefall_1_0/Decompile/DaytimeSensitiveLight.cs')
| -rw-r--r-- | Thronefall_1_0/Decompile/DaytimeSensitiveLight.cs | 83 |
1 files changed, 0 insertions, 83 deletions
diff --git a/Thronefall_1_0/Decompile/DaytimeSensitiveLight.cs b/Thronefall_1_0/Decompile/DaytimeSensitiveLight.cs deleted file mode 100644 index da571d3..0000000 --- a/Thronefall_1_0/Decompile/DaytimeSensitiveLight.cs +++ /dev/null @@ -1,83 +0,0 @@ -using System.Collections; -using UnityEngine; - -[RequireComponent(typeof(Light))] -public class DaytimeSensitiveLight : MonoBehaviour, DayNightCycle.IDaytimeSensitive -{ - [SerializeField] - private Color dayColor = Color.white; - - [SerializeField] - private Color sunsetColor; - - [SerializeField] - private Color nightColor; - - [SerializeField] - private float dayToSunsetDuration = 2f; - - [SerializeField] - private float sunsetToNightDuration = 2f; - - private Light targetLight; - - private void Start() - { - targetLight = GetComponent<Light>(); - DayNightCycle.Instance.RegisterDaytimeSensitiveObject(this); - } - - public void OnDawn_AfterSunrise() - { - } - - public void OnDusk() - { - StopAllCoroutines(); - StartCoroutine(ToNight()); - } - - public void OnDawn_BeforeSunrise() - { - StopAllCoroutines(); - StartCoroutine(ToDay()); - } - - private IEnumerator ToDay() - { - float timer2 = 0f; - while (timer2 <= sunsetToNightDuration) - { - timer2 += Time.deltaTime; - targetLight.color = Color.Lerp(nightColor, sunsetColor, timer2 / sunsetToNightDuration); - yield return null; - } - timer2 = 0f; - while (timer2 <= dayToSunsetDuration) - { - timer2 += Time.deltaTime; - targetLight.color = Color.Lerp(sunsetColor, dayColor, timer2 / dayToSunsetDuration); - yield return null; - } - targetLight.color = dayColor; - } - - private IEnumerator ToNight() - { - float timer2 = 0f; - while (timer2 <= dayToSunsetDuration) - { - timer2 += Time.deltaTime; - targetLight.color = Color.Lerp(dayColor, sunsetColor, timer2 / dayToSunsetDuration); - yield return null; - } - timer2 = 0f; - while (timer2 <= sunsetToNightDuration) - { - timer2 += Time.deltaTime; - targetLight.color = Color.Lerp(dayColor, nightColor, timer2 / sunsetToNightDuration); - yield return null; - } - targetLight.color = nightColor; - } -} |
