HyperlinkNode.cs 836 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using UnityEngine;
  2. namespace WXB
  3. {
  4. public class HyperlinkNode : TextNode
  5. {
  6. bool isEnter = false;
  7. public Color hoveColor = Color.red; // 超链接时的悬浮颜色
  8. public string d_link; // 链接文本
  9. public override void onMouseEnter()
  10. {
  11. isEnter = true;
  12. owner.SetRenderDirty();
  13. }
  14. public override Color currentColor
  15. {
  16. get { return isEnter ? hoveColor : d_color; }
  17. }
  18. public override void onMouseLeave()
  19. {
  20. isEnter = false;
  21. owner.SetRenderDirty();
  22. }
  23. public override bool IsHyText()
  24. {
  25. return true;
  26. }
  27. public override void Release()
  28. {
  29. base.Release();
  30. isEnter = false;
  31. }
  32. };
  33. }