LocalizationText.cs 635 B

123456789101112131415161718192021222324
  1. using UnityEngine;
  2. namespace Nxr.Internal
  3. {
  4. public class LocalizationText : MonoBehaviour
  5. {
  6. public string key = " ";
  7. void Start()
  8. {
  9. GetComponent<TextMesh>().text = LocalizationManager.GetInstance.GetValue(key);
  10. }
  11. public void UpdateKey(string keyValue)
  12. {
  13. this.key = keyValue;
  14. GetComponent<TextMesh>().text = LocalizationManager.GetInstance.GetValue(key);
  15. }
  16. public void refresh(string language)
  17. {
  18. GetComponent<TextMesh>().text = LocalizationManager.GetInstance.GetValue(key, language);
  19. }
  20. }
  21. }