DatePicker/TextMesh Pro/DatePicker_TextMeshProDefaults.cs
Станислав Хозяенок c5f99b234e DatePicker init
2025-04-28 12:20:51 +07:00

27 lines
728 B
C#

using UnityEngine;
using UnityEngine.UI;
using TMPro;
namespace UI.Dates
{
/// <summary>
/// This component will call 'ApplyDefaultTextMeshProProperties' on the TextMesh Pro instance it is attached to
/// when the instance becomes active, and then it will remove itself (so this is a once-off process)
/// </summary>
[ExecuteInEditMode]
public class DatePicker_TextMeshProDefaults : MonoBehaviour
{
public void OnEnable()
{
var tmp = GetComponent<TextMeshProUGUI>();
if (tmp != null)
{
DatePicker_TextMeshProUtilities.ApplyDefaultTextMeshProProperties(tmp);
}
DestroyImmediate(this);
}
}
}