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

namespace RothenburgAR.UI
{
    public class FontsizeSelector : MonoBehaviour
    {
        public FontsizeClass SizeClass = FontsizeClass.Body;

        void OnEnable()
        {
            var tmproTextUI = gameObject.GetComponent<TMPro.TextMeshProUGUI>();
            if (tmproTextUI != null)
            {
                tmproTextUI.fontSize = FontsizeManager.Instance.GetFontsize(this.SizeClass);
            }

            var tmproText = gameObject.GetComponent<TMPro.TextMeshPro>();
            if (tmproText != null)
            {
                tmproText.fontSize = FontsizeManager.Instance.GetFontsize(this.SizeClass);
            }
        }
    }
}