PlatformLightDarknessReader
A class in Root.Township, the global namespace.
Darkness reader method that checks every so often whether the local player's head is out of range of all platform lights, and requests a spawn if so. Client-side.
Constructors
Fields
2 private and internal fields
| Member | What it is |
|---|
private float timer | Time left until the next darkness check. |
private IUnityUpdateMethod update | The registered late update method, or null when not running. |
Methods
| Member | What it is |
|---|
protected override void DisableInternal() | Stops the update loop and unhooks the local player event. |
protected override void EnableInternal() | Resets the timer, starts the update loop if there's a local player, and watches for the local player changing. |
3 private and internal methods
| Member | What it is |
|---|
private bool IsInDarkness() | True when no relevant platform light is within range of the head (range scaled by settings, within 10 m vertically). |
private void UpdateLoop() | Counts down and, every read interval, requests a spawn if the player is in darkness. |
private void UpdatePlayer(PlayerController player) | Starts or stops the update loop when the local player is set or cleared. |