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

namespace MPStudio
{
    public enum FontSizeEnum
    {
        Null,
        S,
        M,
        L
    } 
    

    public class FontTypeSize : MonoBehaviour
    {

        public int fontSize = 0;
        
        public string fontType = "";
        
        public FontSizeEnum fontSizeEnum = FontSizeEnum.S;

        private Text _txt;
        private void Awake()
        {
            _txt = GetComponent<Text>();
        }

        // Start is called before the first frame update
        void Start()
        {
            if (fontType != "")
            {
                _txt.font = ResManager.Inst.LoadFont(this.fontType);
            }

            if (this.fontSize!=0)
            {
                _txt.fontSize = this.fontSize;
            }
            else if (fontSizeEnum == FontSizeEnum.L)
            {
                _txt.fontSize = 27;
            }else if (fontSizeEnum == FontSizeEnum.M)
            {
                _txt.fontSize = 24;
            }else if (fontSizeEnum == FontSizeEnum.S)
            {
                _txt.fontSize = 21;
            }
        }
    }
}