LanguageSelectorUI
Overview
Simple carousel that slides three labels (e.g., EN/ES/CA) horizontally using DOTween. Initializes positions from PlayerPrefs("LANGUAGE") and supports left/right navigation handlers.
Serialized
- RectTransform
leftObj,centerObj,rightObj - float
slideDuration
Behavior
- Start()
- Cache the original anchored positions for each slot.
- Read
LANGUAGEfromPlayerPrefsand instantly arrange so the saved language appears in the center.
- OnRightButtonPressed / OnLeftButtonPressed
- Animate positions: center → left/right; right/left → center; offscreen item jumps to far side; then swap the references so subsequent moves are relative to the new order.