2017-07-30 20:13:29 +08:00
|
|
|
|
/// 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
|
2017-07-30 20:13:29 +08:00
|
|
|
|
[RequireComponent(typeof(Text))]
|
2023-02-04 19:22:31 +08:00
|
|
|
|
#endif
|
2017-07-30 20:13:29 +08:00
|
|
|
|
[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
|
2017-07-30 20:13:29 +08:00
|
|
|
|
uiGraphic = GetComponent<Text>();
|
2023-02-04 19:22:31 +08:00
|
|
|
|
#endif
|
|
|
|
|
}
|
2017-07-30 20:13:29 +08:00
|
|
|
|
|
|
|
|
|
base.ReportSet();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|