Skip to main content

VariableIntensityPlayerLight

A class in Root.Township, Features.

Light on the player that brightens with the number of orbs carried. Reached through PlayerController.PlayerLight.

Constructors​

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

Fields​

5 private and internal fields
MemberWhat it is
private float maxIntensityHighest intensity allowed (default 2.5).
private float minIntensityLowest intensity; at or below this the light is turned off.
private PlatformLight platformLightThe PlatformLight being driven.
private Color playerLightColorWithOrbColour used while carrying orbs (default green).
private float playerLightIntensityPerOrbIntensity added per orb carried (default 0.5).

Methods​

MemberWhat it is
void SetLightColor(Color color)Sets the light's colour.
void SetLightIntensityForOrbCount(int orbCount)Turns the light off at zero orbs, otherwise sets intensity to orbs times playerLightIntensityPerOrb and the orb colour.
void SetPlayerLightEnabled(bool shouldEnable)Turns the light component on or off.
void SetPlayerLightIntensity(float intensity)Sets intensity clamped between the min and max; the light is off unless it is above the minimum.

Used in​

Members of other types that take, return or hold a VariableIntensityPlayerLight: