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.
- Listed in Global namespace: P
- Inherits or implements
MonoBehaviour,ISavable<PlaceItemNoDockPuzzleLogicSaveData>,ISavableSave<PlaceItemNoDockPuzzleLogicSaveData>,ISavableSaveBase - Derived types
PlaceItemNoDockPuzzleLogicSaveData
Constructors
| Member | What it is |
|---|---|
PlaceItemNoDockPuzzleLogic() | Creates a PlaceItemNoDockPuzzleLogic with default values. |
Fields
6 private and internal fields
| Member | What it is |
|---|---|
private PlaceItemNoDockPuzzleLogicSaveData config | Saved puzzle setup: the options (item lists and outputs) plus the empty and invalid outputs. |
private bool hasCorrectItem | True when the last check found a matching item. |
private BoolUnityEvent onValidItemChanged | Event fired with whether a matching item is present. |
private IntUnityEvent onValueChanged | Event fired with the output value of the current state. |
private List<Pickup> pickupsInCollider | Item pickups currently inside the trigger. |
private Timeline.IEntry replaceTimeline | Pending 10 second timer started by a correct item. |
Methods
9 private and internal methods
| Member | What 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. |