36 lines
553 B
C#
36 lines
553 B
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class RewiredButtonsLocalizationUIText : MonoBehaviour
|
|
{
|
|
public string key;
|
|
|
|
private void Start()
|
|
{
|
|
}
|
|
|
|
private void Update()
|
|
{
|
|
}
|
|
|
|
public void RefreshText()
|
|
{
|
|
if (!(LanguageManager.Instance != null))
|
|
{
|
|
return;
|
|
}
|
|
Text component = GetComponent<Text>();
|
|
if ((bool)component)
|
|
{
|
|
if (string.IsNullOrEmpty(LanguageManager.Instance.GetText(key)))
|
|
{
|
|
component.text = "Key error: " + key;
|
|
}
|
|
else
|
|
{
|
|
component.text = LanguageManager.Instance.GetText(key);
|
|
}
|
|
}
|
|
}
|
|
}
|