using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace RothenburgAR.UI
{
    public class LocalizationSelector : MonoBehaviour
    {
        public string LocalizationToken;

        void OnEnable()
        {
            var tmproTextUI = gameObject.GetComponent<TMPro.TextMeshProUGUI>();
            if (tmproTextUI != null)
            {
                tmproTextUI.text = LanguageManager.Instance.GetString(this.LocalizationToken);
            }

            var tmproText = gameObject.GetComponent<TMPro.TextMeshPro>();
            if (tmproText != null)
            {
                tmproText.text = LanguageManager.Instance.GetString(this.LocalizationToken);
            }
        }
    }
}