| 12345678910111213141516171819 |
- using System;
- using UnityEngine;
- using UnityEngine.UI;
- [RequireComponent(typeof(Button))]
- public class ButtonLocalization : 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<Button>().GetComponentInChildren<Text>().text = LocalizationManager.Instance.GetText(key);
- }
- internal void UpdateText() {
- GetComponent<Button>().GetComponentInChildren<Text>().text = LocalizationManager.Instance.GetText(key);
- }
- }
|