A class in Root.Township, Alta.Crafting.
Turns off a platform light on a crafting part when its root pickup is shrunk into a dock that does not allow glowing items, and back on when undocked.
Constructors
| Member | What it is |
|---|
DisableLightOnDock() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
2 private and internal fields
| Member | What it is |
|---|
private Pickup pickup | Pickup of the current root part. |
private PlatformLight targetLight | The light to turn on and off. |
Methods
5 private and internal methods
| Member | What it is |
|---|
private void Awake() | Starts listening for the crafting part's root changes. |
private void CheckEnabledEnable(Interactor interactor, Pickup pickup, PickupDock dock) | On docking: keeps the light on only if the dock allows glowing items or is not scaling the pickup. |
private void ForceEnable(Interactor interactor, Pickup pickup, PickupDock dock) | On undocking: turns the light back on. |
private void OnDestroy() | Removes the dock and undock hooks from the pickup. |
private void RootSet(CraftingPart root) | Moves the dock and undock hooks to the new root's pickup. |