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, setsalphaHitTestMinimumThreshold = 0.5, starts SelectedFadeEffect(). - Tick() → sets
image.color.rgb = TargetColor().rgband forcesa = 1. - SelectedFadeEffect()
- When
selectedRegion == region: ping–pongs a fade multiplier betweenselectedFadeEffectMin..1. - Otherwise: eases the multiplier back to
1overdeselectedReturnTime.
- When
- TargetColor()
- If
region.Control >= 1→fullControlColor * fade. - Else →
Lerp(startingColor, controlledColor, region.Control) * fade.
- If
- OnDisable/OnDestroy → stops coroutines.