RegionTintUI

Overview

Image tint that reflects a region’s control and subtly pulses when the region is selected. The color blends from the sprite’s startingColor → controlledColor as control rises, and switches to fullControlColor at 100%. The pulse uses a SmoothStep ping–pong between selectedFadeEffectMin and 1.

Serialized

  • RegionVariable selectedRegion — current focus.
  • Region region — the region this icon represents.
  • float selectedFadeEffectTime, selectedFadeEffectMin, deselectedReturnTime — pulse timings.
  • Color controlledColor, fullControlColor.

Behavior

  • Awake/OnEnable → caches the Image, sets alphaHitTestMinimumThreshold = 0.5, starts SelectedFadeEffect().
  • Tick() → sets image.color.rgb = TargetColor().rgb and forces a = 1.
  • SelectedFadeEffect()
    • When selectedRegion == region: ping–pongs a fade multiplier between selectedFadeEffectMin..1.
    • Otherwise: eases the multiplier back to 1 over deselectedReturnTime.
  • TargetColor()
    • If region.Control >= 1fullControlColor * fade.
    • Else → Lerp(startingColor, controlledColor, region.Control) * fade.
  • OnDisable/OnDestroy → stops coroutines.