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

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

        void OnEnable()
        {
            var tmproText = gameObject.GetComponent<TMPro.TextMeshProUGUI>();
            if (tmproText != null)
            {
                tmproText.enableAutoSizing = true;
                tmproText.fontSizeMax = FontsizeManager.Instance.GetFontsize(this.SizeClass);
                tmproText.fontSizeMin = tmproText.fontSizeMax * 0.8f;
            }
        }

        void Update()
        {

        }
    }

}