Skip to main content

PuzzleDoor

A class in Root.Township, the global namespace.

Test door for the light puzzle: turns its material green when its condition is complete and red when not. It doesn't move.

Constructors​

MemberWhat it is
PuzzleDoor()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

1 private and internal field
MemberWhat it is
private PuzzleCondition conditionCondition that opens the door.

Methods​

4 private and internal methods
MemberWhat it is
private void Awake()Subscribes to the condition and applies its current state.
private void CloseDoor()Sets the renderer colour to red.
private void DoorStateChanged(PuzzleCondition condition)Opens or closes the door to match the condition, logging each change.
private void OpenDoor()Sets the renderer colour to green.