Automatically updates a TMP_Text component with a localized string from the LocalizationManager, based on the current language.
More...
Automatically updates a TMP_Text component with a localized string from the LocalizationManager, based on the current language.
This component supports both key-based and inline per-language string definitions via a LocalizedString reference.
Usage:
- Attach this script to a GameObject with a
TMP_Text
component.
- Assign a
LocalizedString
in the Inspector (either using a key or manual language entries).
- When the language changes, the text updates automatically.
Example:
- localizedString.key = "menu.title"
- English: "Start Game"
- Spanish: "Iniciar Juego"
Notes:
- Requires a
TMP_Text
component (from TextMeshPro).
- Displays a warning if no localized string is found.
◆ Awake()
void Backbone::LocalizedTMP_Text::Awake |
( |
| ) |
|
|
private |
◆ OnDisable()
void Backbone::LocalizedTMP_Text::OnDisable |
( |
| ) |
|
|
private |
◆ OnEnable()
void Backbone::LocalizedTMP_Text::OnEnable |
( |
| ) |
|
|
private |
◆ UpdateText()
void Backbone::LocalizedTMP_Text::UpdateText |
( |
| ) |
|
|
private |
Updates the TMP_Text content using the localized value from the manager.
◆ localizedString
Localized string definition (can use a key or inline values).
◆ tmpText
TMP_Text Backbone::LocalizedTMP_Text::tmpText |
|
private |
The documentation for this class was generated from the following file: