RegionPanelUI

Overview

The main Region Panel controller. Opens/closes with DOTween, populates the background by biome and presence, and shows/hides subpanels for Build Lab, Lab controls, and Incoming Route depending on state. Also hides itself when the Event or Route canvas opens.

Serialized (Atoms & UI)

  • ChairmanEventEvent openEventCanvas
  • VoidEvent openRouteCanvas
  • IntVariable maxLabs, labCount
  • DOTweenAnimation showPanelTween
  • LeanButton hideShowButton
  • Image regionBackground
  • GameObjects regionLabUI, regionRouteUI, buildLabUI, controlSlider, marketControlledIcon
  • SFXSingle onOpenPanelSFX, onClosePanelSFX
  • Sprites for each biome in lab and empty variants

Behavior

  • Subscribes to openEventCanvas/openRouteCanvas to hide.
  • OnOpenPanel() / OnHideShowButtonPressed() — toggles the panel in/out and updates background + child UIs.
  • OnSelectedRegionChanged()
    • Ensures the panel is visible, enables the toggle button, sets the background by biome, and calls UpdateUI().
  • UpdateUI()
    • Build Lab visible when: no Lab and no Distribution Spot and labCount < maxLabs and no incoming route.
    • Lab UI visible when the region has a Lab.
    • Market controlled icon shown when Control >= 1; else control slider shown.
    • Route UI visible when there is an incoming route.
  • Background sprite chooses lab vs empty variant depending on Presence or whether the region has a Lab or Distribution Spot.