Skip to main content

PlaceItemNoDockPuzzleLogic

A class in Root.Township, the global namespace.

Puzzle trigger that checks whether the right item has been placed inside it (not docked) and fires an output value and a valid flag for the matching option.

Constructors​

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

Fields​

6 private and internal fields
MemberWhat it is
private PlaceItemNoDockPuzzleLogicSaveData configSaved puzzle setup: the options (item lists and outputs) plus the empty and invalid outputs.
private bool hasCorrectItemTrue when the last check found a matching item.
private BoolUnityEvent onValidItemChangedEvent fired with whether a matching item is present.
private IntUnityEvent onValueChangedEvent fired with the output value of the current state.
private List<Pickup> pickupsInColliderItem pickups currently inside the trigger.
private Timeline.IEntry replaceTimelinePending 10 second timer started by a correct item.

Methods​

9 private and internal methods
MemberWhat it is
private bool CheckIfCorrect(Item item)If the item is in one of the options, fires that option's output and true, and returns true.
private void CheckReplace()Timer callback 10 seconds after a correct item; it only logs and clears the timer.
private void DestroyedEventRemove(NetworkEntity entity, bool isUnload)Stops tracking a pickup whose entity was destroyed, then rechecks.
private void DockedEventRemove(Interactor arg1, Pickup arg2, PickupDock arg3)Stops tracking a pickup that docked somewhere, then rechecks.
private void OnDestroy()Cancels the replace timer.
private void OnTriggerEnter(Collider other)Starts tracking an item pickup that enters and checks it.
private void OnTriggerExit(Collider other)Stops tracking an item pickup that leaves, then rechecks.
private void RefreshItemCheck(Pickup pickup)Rechecks every tracked pickup; fires the invalid output if none match, or the empty output if the trigger is empty.
private void RemoveFromList(Pickup pickup)Unhooks a pickup's events and removes it from pickupsInCollider.