diff options
author | chai <215380520@qq.com> | 2023-11-26 23:52:30 +0800 |
---|---|---|
committer | chai <215380520@qq.com> | 2023-11-26 23:52:30 +0800 |
commit | 626381f061cde0c78564f6336e3131835cf20a5b (patch) | |
tree | d9991d6eda6ae5d7649ac91ecaa3b4dc833cd4c3 /Assembly_CSharp/LightManager.cs | |
parent | 0e63c4a2c6dec8dfa260501fb7d73750261ea7b7 (diff) |
* move
Diffstat (limited to 'Assembly_CSharp/LightManager.cs')
-rw-r--r-- | Assembly_CSharp/LightManager.cs | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/Assembly_CSharp/LightManager.cs b/Assembly_CSharp/LightManager.cs deleted file mode 100644 index e38ac0f..0000000 --- a/Assembly_CSharp/LightManager.cs +++ /dev/null @@ -1,62 +0,0 @@ -using System.Collections; -using UnityEngine; - -public class LightManager : MonoBehaviour -{ - [SerializeField] - private Color stage2Color; - - [SerializeField] - private Color stage3Color; - - [SerializeField] - private Color stage4Color; - - [SerializeField] - private Light light; - - private void Start() - { - } - - public void ChangeColor(int stage) - { - switch (stage) - { - case 2: - StartCoroutine(ShiftLight(stage2Color, 180f)); - break; - case 3: - StartCoroutine(ShiftLight(stage3Color, 180f)); - break; - case 4: - StartCoroutine(ShiftLight(stage4Color, 180f)); - break; - } - } - - private IEnumerator ShiftLight(Color newColor, float rotationInDeg) - { - Color startColor = light.color; - Vector3 startEuler = light.transform.eulerAngles; - Vector3 newEuler = startEuler + new Vector3(0f, rotationInDeg, 0f); - float timer = 0f; - float count = 0f; - while (timer < 1f) - { - light.color = Color.Lerp(startColor, newColor, timer); - light.transform.eulerAngles = Vector3.Lerp(startEuler, newEuler, timer); - count += Time.deltaTime; - if (count > 60f) - { - Debug.LogError("Possible infinite loop"); - break; - } - timer += Time.deltaTime / 30f; - yield return new WaitForEndOfFrame(); - } - light.color = newColor; - light.transform.eulerAngles = newEuler; - yield return null; - } -} |