Skip to main content

BaseLightsController

An abstract class in Root.Township, Alta.Lighting.

Base for the platform light controllers (PC and Android) that manage the active PlatformLights and tick while any are active.

Constructors​

MemberWhat it is
protected BaseLightsController()Creates a BaseLightsController with default values.

Fields​

MemberWhat it is
protected HashSet<PlatformLight> activeLightsBacking set of active lights.
1 private and internal field
MemberWhat it is
private IUnityUpdateMethod updateRegistered update method; added when the first light is added and removed when the last one goes.

Properties​

MemberWhat it is
IEnumerable<PlatformLight> ActiveLights { get; }The lights currently registered.

Methods​

MemberWhat it is
virtual void AddLight(PlatformLight light)Registers a light. The first one starts the update and calls OnEnabled.
virtual void RemoveLight(PlatformLight light)Unregisters a light. When none are left it stops the update and calls OnDisabled.
protected virtual void OnDisabled()Called when the last light is removed.
protected virtual void OnEnabled()Called when the first light is added.
protected abstract void Update()Called each frame while there are active lights.

Used in​

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