liquid star

This commit is contained in:
Nathan Rashleigh committed 2026-03-27 17:50:58 +11:00
1 parent ba45c55d48
commit b261f4d3d0
20 files changed
+1049 -18

No files matched your search

+26
View File
@@ -0,0 +1,26 @@
using UnityEngine;
public class FlickerLight : MonoBehaviour {
[SerializeField] float baseIntensity = 8f;
[SerializeField] float flickerAmount = 2f;
[SerializeField] float speed = 1.5f;
Light _light;
float _offset;
void Start() {
_light = GetComponent<Light>();
if (_light) baseIntensity = _light.intensity;
_offset = Random.value * 100f;
}
void Update() {
if (!_light) return;
float t = Time.time * speed + _offset;
float noise = Mathf.PerlinNoise(t, _offset) * 2f - 1f;
noise += (Mathf.PerlinNoise(t * 2.7f, _offset + 50f) * 2f - 1f) * 0.4f;
_light.intensity = baseIntensity + noise * flickerAmount;
}
}