| 123456789101112131415161718 |
- using UnityEngine;
- using UnityEngine.UI;
- [RequireComponent(typeof(Text))]
- public class TextLocalization : MonoBehaviour
- {
- public string key;
- void Start() {
- // Get the string value from localization manager from key
- // and set the text component text value to the returned string value
- GetComponent<Text>().text = LocalizationManager.Instance.GetText(key);
- }
- public void UpdateText() {
- GetComponent<Text>().text = LocalizationManager.Instance.GetText(key);
- }
- }
|