DestroyLabPanelUI
Overview
Confirmation panel for dismantling the current region’s Laboratory and all its routes, showing a detailed refund breakdown for both lab and routes using the configured refund multipliers. Pauses gameplay while visible and disables time controls.
Serialized Atoms
- IntVariable
labCount - FloatVariable
labRefund,labCost - FloatVariable
routeBaseCost,routeCostPerNode,routeCostMultiplier,routeRefund - RegionVariable
currentRegion - BoolVariable
paused - VoidEvent
enableTimeControls,disableTimeControls
UI
- TextMeshProUGUI
infoText
Behavior
- OnEnable()
- Computes:
- ExpectedLabCount =
labCount - 1 - Lab Cost at that count:
labCost.InitialValue * (ExpectedLabCount + 1) - Route Total Cost = sum over each route:
(routeBaseCost + routeCostPerNode * NodesTraversed) * routeCostMultiplier - Total Refund =
(Lab Cost × labRefund) + (Route Total Cost × routeRefund)
- ExpectedLabCount =
- Formats
infoTextwith Region name, Lab Cost, Lab Refund %, Route Total Cost, Route Refund %, and the combined Total Refund (Spanish locale +$). - Sets
paused = trueand raisesdisableTimeControls.
- Computes:
- OnConfirmButtonPressed()
currentRegion.Value.RemoveLaboratory(true), hides, unpauses, and re-enables time controls.
- OnDenyButtonPressed()
- Hides, unpauses, and re-enables time controls.
Notes
- Uses the current NodesTraversed on each route to reflect distance-based construction cost before refunding.