LightHands
A class in Root.Township, the global namespace.
Debug light on a player's hand, toggled by the DebugLight controller action for users with the debug_features permission. Cycles off, strong and flickering.
- Listed in Global namespace: I to L
- Inherits or implements
ControllerExtension - Nested types
Modes
Constructors
| Member | What it is |
|---|---|
LightHands() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
9 private and internal fields
| Member | What it is |
|---|---|
private LightHands.Modes currentMode | Off, strong or flickering. |
private float fadeTime | Seconds to fade in or out. 0.5. |
private Gradient flickColors | Gradient used while flickering. |
private float flickRange | Light range while flickering. |
private float intensity | Light intensity while flickering. |
private float lerpSpeed | How fast the flicker colour drifts. |
private PlatformLight lightObject | The hand light. |
private float strongRange | Light range in strong mode. |
private float time | Fade progress in seconds. |
Properties
1 private and internal property
Methods
| Member | What it is |
|---|---|
void Toggle() | Moves to the next mode: off fades out, strong is white at long range, flickering is short range with shifting colours. |
6 private and internal methods
| Member | What it is |
|---|---|
private IEnumerator AmpUp() (iterator) | Coroutine that turns the light on and fades its intensity up to 1. |
private void ButtonPressed(PlayerInput controller) | Handles the DebugLight action. Does the same as Toggle. |
private IEnumerator FadeOut() (iterator) | Coroutine that fades the light out, then turns it and this component off. |
private void OnDestroy() | Destroys the light along with this component. |
private void Start() | Subscribes to the DebugLight action if the user has debug_features. |
private void Update() | While flickering, drifts the colour towards random gradient colours. |