RegionRouteUI

Overview

Inline controls for a region’s incoming route. Lets the player pause/resume, remove, or reroute that route. Rerouting stores the current route into a shared variable and opens the Route canvas.

Serialized

  • BoolVariable reroutingEnabled
  • RouteVariable reroutingRoute
  • VoidEvent openRouteCanvas
  • LeanButton pauseRouteButton, resumeRouteButton, rerouteRouteButton

Behavior

  • UpdateUI() — if there is an incoming route, enables the reroute button based on reroutingEnabled, and toggles Pause/Resume visibility by incomingRoute.Paused.
  • OnRerouteButtonPressed() — sets reroutingRoute to the incoming route and raises openRouteCanvas.
  • OnRemoveRouteButtonPressed() — finds the parent Lab via LabGroupRegistrar and calls RemoveRoute(incomingRoute).
  • OnPause/OnResume — flips incomingRoute.Paused and swaps the two buttons.