Big project cleanup with overhaul of file responsibilities (KISS) and code (DRY, YAGNI)
This commit is contained in:
@@ -1,23 +1,22 @@
|
||||
using Godot;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public class LightHandler
|
||||
public static class LightHandler
|
||||
{
|
||||
public static List<OmniLight3D> lights = new List<OmniLight3D>();
|
||||
public static List<OmniLight3D> lights = new List<OmniLight3D>();
|
||||
|
||||
public static void RedrawLights(Color color)
|
||||
{
|
||||
List<OmniLight3D> availableLights = new List<OmniLight3D>();
|
||||
public static void RedrawLights(Color color)
|
||||
{
|
||||
List<OmniLight3D> availableLights = new List<OmniLight3D>();
|
||||
|
||||
foreach (OmniLight3D light in lights)
|
||||
{
|
||||
if (GodotObject.IsInstanceValid(light))
|
||||
{
|
||||
light.LightColor = color;
|
||||
availableLights.Add(light);
|
||||
}
|
||||
}
|
||||
foreach (OmniLight3D light in lights)
|
||||
{
|
||||
if (!GodotObject.IsInstanceValid(light)) continue;
|
||||
|
||||
lights = availableLights;
|
||||
}
|
||||
light.LightColor = color;
|
||||
availableLights.Add(light);
|
||||
}
|
||||
|
||||
lights = availableLights;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user