organize scripts

This commit is contained in:
2026-05-05 21:01:16 -05:00
parent f4be1941d3
commit 343a27936c
18 changed files with 16 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
using UnityEngine;
// Very simple script, just takes a light on start and slowly fades it to 0
// over the duration specified.
[RequireComponent(typeof(Light))]
public class FadingLight : MonoBehaviour
{
Light lightObj;
public float duration;
public bool isFading;
float timer;
float startIntensity;
void Start()
{
lightObj = GetComponent<Light>();
startIntensity = lightObj.intensity;
}
void Update()
{
timer += Time.deltaTime;
float t = timer / duration;
t = Mathf.Clamp01(t);
lightObj.intensity = Mathf.Lerp(startIntensity, 0, t);
}
}
+2
View File
@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 2742aa9b9a50a9d458a4daef485a3956