RedDotTmpBind.cs 615 B

1234567891011121314151617181920212223242526
  1. #if TextMeshPro
  2. using TMPro;
  3. using UnityEngine;
  4. using Sirenix.OdinInspector;
  5. namespace YIUIFramework
  6. {
  7. [AddComponentMenu("YIUIFramework/红点/红点TMP绑定 【RedDotTextBind】")]
  8. public class RedDotTmpBind : RedDotBind
  9. {
  10. [PropertyOrder(int.MinValue)]
  11. [SerializeField]
  12. [LabelText("文本")]
  13. [EnableIf("@UIOperationHelper.CommonShowIf()")]
  14. private TextMeshProUGUI m_Text;
  15. protected override void ChangeText()
  16. {
  17. if (m_Text != null)
  18. {
  19. m_Text.text = Count.ToString();
  20. }
  21. }
  22. }
  23. }
  24. #endif