Skip to main content

DarknessReaderMethod

An abstract class in Root.Township, the global namespace.

Base for a way of measuring how dark it is around the local player, which can ask for darkness creatures to spawn. Only runs for the local player on a client.

Constructors​

MemberWhat it is
DarknessReaderMethod(DarknessReader reader, PlayerController character, Action requestSpawn)Creates a DarknessReaderMethod from reader, character and requestSpawn.

Fields​

MemberWhat it is
protected readonly PlayerController characterThe player being measured around.
protected static Logger loggerShared logger.
protected readonly DarknessReader readerThe darkness reader that owns this method.
protected readonly Action requestSpawnCall to ask for a darkness spawn.
protected readonly DarknessSpawnerSettings settingsDarknessSpawnerSettings.Instance.

Properties​

MemberWhat it is
bool IsEnabled { get; private set; }Whether the method is running.

Methods​

MemberWhat it is
void Disable()Stops the method if it's running.
void Enable()Starts the method. Logs a warning and does nothing on a headless server or for a remote player.
protected abstract void DisableInternal()Subclasses stop measuring here.
protected abstract void EnableInternal()Subclasses start measuring here.

Used in​

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