com.unity.uiextensions/Runtime/Scripts/Effects/CurlyUI/CUIText.cs

29 lines
736 B
C#
Raw Normal View History

/// Credit Titinious (https://github.com/Titinious)
/// Sourced from - https://github.com/Titinious/CurlyUI
namespace UnityEngine.UI.Extensions
{
[RequireComponent(typeof(RectTransform))]
2023-02-04 19:22:31 +08:00
#if UNITY_2022_1_OR_NEWER
[RequireComponent(typeof(TMPro.TMP_Text))]
#else
[RequireComponent(typeof(Text))]
2023-02-04 19:22:31 +08:00
#endif
[AddComponentMenu("UI/Effects/Extensions/Curly UI Text")]
public class CUIText : CUIGraphic
{
public override void ReportSet()
{
if (uiGraphic == null)
2023-02-04 19:22:31 +08:00
{
#if UNITY_2022_1_OR_NEWER
uiGraphic = GetComponent<TMPro.TMP_Text>();
#else
uiGraphic = GetComponent<Text>();
2023-02-04 19:22:31 +08:00
#endif
}
base.ReportSet();
}
}
}