RouteBuilderUI
Overview
Coordinator for the route construction flow. Tracks the list of selected nodes, highlights connections, enables Confirm/Undo, integrates with TutorialMaster, and supports rerouting by seeding from an existing route. fileciteturn22file3
Core Behavior
- OnEnable(): clears state,
NodeMap.UnfocusAllConnections(), seeds fromreroutingRouteorcurrentRegion, disables confirm (half-alpha), movesbuttonsAnchorto last node, raisesupdateRouteUI. fileciteturn22file3 - AddNode(GameObject):
- Inserts sea connection intermediates when needed.
- Shows builder usage + focus on all connections.
- Moves
buttonsAnchorto the new node. - Confirm becomes interactable only when last node is not MARITIME, has no incoming route, and has no Lab.
- Updates
currentRegionwithout emitting itsChangedevent. - Applies tutorial-specific interactivity overrides. fileciteturn22file3
- RemoveLastNode():
- Hides last connection usage, pops, updates icons/eligibility, raises UI, syncs
currentRegion&selectedRegionVariable. If only the start remains, undo icon changes to quit; another press → ExitBuilding(). fileciteturn22file3
- Hides last connection usage, pops, updates icons/eligibility, raises UI, syncs
- ExitBuilding(): reopens lab canvas, raises
openRegionCanvas(false), clearsreroutingRoute. - OnDisable(): clears all builder usage; OnDestroy(): unregisters event. fileciteturn22file3
UI & Atoms
currentRegion, reroutingRoute, updateRouteUI, addNodeToRoute, openRegionCanvas, selectedRegionVariable, AddRoutePanelUI refs, confirm/undo buttons & icons. fileciteturn22file3