RedDotTextBind.cs 595 B

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