2020-08-22 05:29:00 +00:00
|
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
using TMPro;
|
|
|
|
|
|
|
|
|
|
public class LocalizationButtonInjector : MonoBehaviour {
|
|
|
|
|
private TMP_Text text;
|
|
|
|
|
|
|
|
|
|
public string key;
|
|
|
|
|
|
|
|
|
|
private void Start() {
|
|
|
|
|
text = GetComponent<TMP_Text>();
|
|
|
|
|
UpdateText();
|
|
|
|
|
}
|
|
|
|
|
|
2020-08-22 16:28:49 +00:00
|
|
|
|
// Texel - Hopefully this allows text to update better when stuff is renabled?
|
|
|
|
|
private void OnEnable() {
|
|
|
|
|
Start();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void UpdateText() {
|
2020-08-22 05:41:26 +00:00
|
|
|
|
text.text = Localization.GetString(key).Replace("\\n", "\n");
|
2020-08-22 05:29:00 +00:00
|
|
|
|
}
|
|
|
|
|
}
|