RegionSliderFillUI
Overview
A procedural fill bar for region stats with optional prediction overlays. It directly resizes a RectTransform (width only) and can recolor overflow states by personality. Variants also pulse a colored overlay when previewing predicted increases.
Serialized
- LinkedData
linkedData— what to show: Police/Cartel Severity, Min Severities, Control, Production, Demand, Overproduction, Predicted variants. - RectTransform
fillTransform— the bar to stretch (width). Constant width baseline:845 px. - ColorConstant
schemerOverproductionColor,subterfugeOverproductionColor; IntVariableselectedPersonality; boolcoloredOverflow. - (Prediction)
FloatEvent predictedChange,Image sliderFill,Color predictedPositiveColor,predictedNegativeColor,float pulseEffectTime,pulseEffectMin.
Live Values (UpdateUI)
- POLICE_SEVERITY / CARTEL_SEVERITY → bar = value × 845. If
coloredOverflowand personality is Schemer (1), tint the fill withschemerOverproductionColorwhile the region is in OverSupply; otherwise revert tostartingColor. - MIN_POLICE_SEVERITY / MIN_CARTEL_SEVERITY → from the region’s min caps.
- CONTROL → bar = Control × 845. If
coloredOverflowand personality is Subterfuge (2), tint withsubterfugeOverproductionColorduring OverSupply. - PRODUCTION →
min(LocalProduction, LocalDemand) / 5f(normalized to 0–1) × 845. - DEMAND →
LocalDemand / 5f× 845. - OVERPRODUCTION →
LocalProduction / 5f× 845.
Predictions (UpdatePredictedUI)
When predictedChange is wired:
- POLICE/CARTEL_SEVERITY → clamp down to
[minSeverity, current]to preview possible reductions. - CONTROL → clamp down to
[0, current]for previewed losses. - PREDICTED_POLICE/CARTEL_SEVERITY/CONTROL → clamp up to
[current, 1]to preview increases, colorsliderFillusing positive/negative colors, and start a PulseEffect() (alpha ping–pong).
Notes
- Pulse uses unscaled deltaTime so it’s visible while the game is paused.
- Unregisters from
predictedChangeon destroy and stops coroutines on disable.