Skip to main content

DarknessTrigger

A static class in Root.Township, the global namespace.

Global darkness flag for the local client. Requests are batched to the next delayed call so only the final state per frame raises OnChanged; DarknessReader listens to it.

Fields​

2 private and internal fields
MemberWhat it is
private static bool isDarkTargetLast requested state.
private static bool isUpdatingTrue while an update is queued.

Properties​

MemberWhat it is
static bool IsDark { get; private set; }Whether the player is currently in a dark area.

Events​

MemberWhat it is
static event Action<bool> OnChangedRaised with the new value when IsDark changes.

Methods​

MemberWhat it is
static void SetIsDark(bool isDark)Requests a new darkness state, applied on a delayed call.
1 private and internal method
MemberWhat it is
private static void UpdateDark()Applies the requested state and raises OnChanged if it changed.