DockedFireLogic
A class in Root.Township, the global namespace.
Puzzle helper that watches the fire on an item docked in a PlaceItemPuzzleLogic dock and raises a bool event when it lights or goes out.
- Listed in Global namespace: C to D
- Inherits or implements
MonoBehaviour
Constructors
| Member | What it is |
|---|---|
DockedFireLogic() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
6 private and internal fields
| Member | What it is |
|---|---|
private bool activatedByLogic | Lets ExternalUpdateFire light or put out the fire. |
private bool correctIfExtinguished | Inverts the value reported on dock, so an unlit fire counts as correct. |
private bool currentValue | Last value sent through onValueUpdated. |
private Fire fire | The fire being watched, found on the docked item or set in the inspector. |
private BoolUnityEvent onValueUpdated | Event raised with the new value whenever it changes. |
private PlaceItemPuzzleLogic placeItemPuzzleLogic | The puzzle whose dock is watched. |
Methods
| Member | What it is |
|---|---|
void ExternalUpdateFire(bool value) | Lights or extinguishes the tracked fire from outside logic, only when activatedByLogic is set. |
4 private and internal methods
| Member | What it is |
|---|---|
private void Awake() | Subscribes to the starting fire (if set) and to the puzzle dock's docked and undocked events. |
private void DockedItemCheck(Interactor interactor, Pickup pickup, PickupDock dock) | On dock, finds the Fire under the dock, subscribes to it and pushes its lit state (inverted when correctIfExtinguished). |
private void UndockedItemCheck(Interactor interactor, Pickup pickup, PickupDock dock) | When the dock is empty, drops the tracked fire and reports false. |
private void UpdateValue(bool value) | Stores the new state and invokes onValueUpdated only when it changed. |