Automatically updates a UI RawImage component with a localized texture from the LocalizationManager, based on the current language.
More...
Automatically updates a UI RawImage component with a localized texture from the LocalizationManager, based on the current language.
This component allows runtime switching of UI textures depending on the selected language. It supports direct per-language assignment or centralized key-based lookup via LocalizationManager.
Usage:
- Attach this component to a GameObject with a
RawImage
component (Unity UI).
- Set the
localizedTexture
in the Inspector, using either a key or manual language entries.
- When the language changes, the RawImage's texture will be updated accordingly.
Example:
- Suppose your localization data contains: Key: "background.menu" English: texture_en.png Spanish: texture_es.png
- In the Inspector: localizedTexture.key = "background.menu"
- At runtime, the correct texture will be shown depending on the active language.
Notes:
- This component requires a
RawImage
component.
- If the key is not found or the texture is missing, a warning is logged.
◆ Awake()
void Backbone::LocalizedRawImage::Awake |
( |
| ) |
|
|
private |
◆ OnDisable()
void Backbone::LocalizedRawImage::OnDisable |
( |
| ) |
|
|
private |
◆ OnEnable()
void Backbone::LocalizedRawImage::OnEnable |
( |
| ) |
|
|
private |
◆ UpdateRawImage()
void Backbone::LocalizedRawImage::UpdateRawImage |
( |
| ) |
|
|
private |
Updates the RawImage's texture using the localized value from the manager.
◆ localizedTexture
Localized texture definition (can use a key or inline values).
◆ rawImageComponent
RawImage Backbone::LocalizedRawImage::rawImageComponent |
|
private |
The documentation for this class was generated from the following file: