Automatically updates the main texture of a material using a localized texture from the LocalizationManager based on the current language.
More...
Automatically updates the main texture of a material using a localized texture from the LocalizationManager based on the current language.
This component allows you to change the visual appearance of materials dynamically in runtime, depending on the selected language.
Usage:
- Attach this component to a GameObject with a Renderer (e.g., MeshRenderer).
- Assign a
LocalizedTexture
in the Inspector (either via key or direct values).
- The material's main texture (
_MainTex
) will be updated when the language changes.
Example:
- localizationKey = "screens.welcome"
- English -> Texture EN
- Spanish -> Texture ES
Notes:
- This updates
material.mainTexture
(which creates an instance of the material).
- Ensure your material uses
_MainTex
or compatible property.
- Logs a warning if no localized texture is found.
◆ Awake()
void Backbone::LocalizedMaterial::Awake |
( |
| ) |
|
|
private |
◆ OnDisable()
void Backbone::LocalizedMaterial::OnDisable |
( |
| ) |
|
|
private |
◆ OnEnable()
void Backbone::LocalizedMaterial::OnEnable |
( |
| ) |
|
|
private |
◆ UpdateMaterial()
void Backbone::LocalizedMaterial::UpdateMaterial |
( |
| ) |
|
|
private |
Updates the material's main texture using the localized texture.
◆ localizedTexture
Localized texture definition (can use a key or inline values).
◆ targetRenderer
Renderer Backbone::LocalizedMaterial::targetRenderer |
|
private |
The documentation for this class was generated from the following file: