Files
RothenburgAR/Assets/RothenburgAR/Scripts/UI/FontsizeSelector.cs
2018-08-24 18:19:09 +02:00

28 lines
678 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace RothenburgAR.UI
{
public class FontsizeSelector : MonoBehaviour
{
public FontsizeClass SizeClass = FontsizeClass.Body;
void Start()
{
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()
{
}
}
}