Skip to main content

LightFlicker

A class in Root.Township, the global namespace.

Client-side effect that drifts a light's colour towards random colours from a gradient. Removes itself on a headless server.

Constructors​

MemberWhat it is
LightFlicker()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

3 private and internal fields
MemberWhat it is
private Gradient colorsGradient the random colours are picked from.
private float lerpSpeedHow fast the colour drifts.
private PlatformLight targetLightThe light on this object.

Methods​

2 private and internal methods
MemberWhat it is
private void Start()Destroys itself when headless, otherwise finds the light.
private void Update()Moves the light colour towards a random gradient colour.