Skip to main content

PlaceItemNoDockFirePuzzleLogic

A class in Root.Township, the global namespace.

Puzzle trigger that reports whether a lit fire (such as a torch) is inside it, firing onValidItemChanged. Items don't need to be docked, just placed in the trigger.

Constructors​

MemberWhat it is
PlaceItemNoDockFirePuzzleLogic()Creates a PlaceItemNoDockFirePuzzleLogic with default values.

Fields​

4 private and internal fields
MemberWhat it is
private PlaceItemNoDockFirePuzzleLogicSaveData configSaved puzzle options. Saved and loaded but not read by the logic here.
private List<Fire> firesInColliderFires currently inside the trigger.
private bool hasCorrectItemTrue when the last check found a lit fire.
private BoolUnityEvent onValidItemChangedEvent fired with whether a lit fire is present.

Methods​

MemberWhat it is
void RefreshItemCheck()Fires onValidItemChanged with true if any tracked fire is lit, otherwise false.
8 private and internal methods
MemberWhat it is
private void DestroyedEventRemove(NetworkEntity entity, bool isUnload)Stops tracking a pickup and its fire when its entity is destroyed, then rechecks.
private void DockedEventRemove(Interactor arg1, Pickup arg2, PickupDock arg3)Stops tracking a pickup and its fire when it docks somewhere, then rechecks.
private void FireSub(Pickup pickup)Hooks the fire's ToggleEvent on a pickup so lighting or putting it out rechecks the puzzle.
private void FireToggle(bool obj)Rechecks the puzzle when a tracked fire is lit or put out.
private void OnTriggerEnter(Collider other)Starts tracking a pickup and any fire that enters, then rechecks.
private void OnTriggerExit(Collider other)Stops tracking a pickup and its fire when it leaves, then rechecks.
private void RemoveFromFireList(Fire fire)Unhooks a fire and removes it from firesInCollider.
private void UnsubFromPickupEvents(Pickup pickup)Unhooks a pickup's docked and destroyed events.