Screw it, I added light

This commit is contained in:
RochesterX
2025-04-20 22:23:34 -04:00
parent 14970499b8
commit be63f2e19d
19 changed files with 9834 additions and 29 deletions

29
Assets/LightCycle.cs Normal file
View File

@@ -0,0 +1,29 @@
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering.Universal;
public class LightCycle : MonoBehaviour
{
public List<Color> colors;
public int targetColorIndex = 0;
public float speed = 1.0f;
private Light2D light2D;
void Start()
{
light2D = GetComponent<Light2D>();
}
void Update()
{
if (light2D.color == colors[targetColorIndex])
{
targetColorIndex = (targetColorIndex + 1) % colors.Count;
}
light2D.color = Color.Lerp(light2D.color, colors[targetColorIndex], Time.deltaTime * speed);
}
}