Automatically updates a UI Image component with a localized sprite from the LocalizationManager.
More...
Automatically updates a UI Image component with a localized sprite from the LocalizationManager.
This component listens to language changes and updates the sprite of the attached Image based on a localization key. It supports runtime localization switching for UI visuals.
Usage:
- Attach this component to a GameObject with an
Image
component (Unity UI).
- Set the
localizationKey
in the Inspector to match a key defined in your localized sprite data.
- At runtime, when the language changes, the image will automatically be updated.
Example:
- Suppose your localization data contains: Key: icons.warning English: warning_en.png Spanish: warning_es.png
- In the Inspector: localizationKey = "icons.warning"
- At runtime, the corresponding sprite will be loaded from the LocalizationManager.
Notes:
- This component requires an
Image
component.
- If the key is not found, a warning is logged and the sprite remains unchanged.