TipInfoMsgManager.cs 691 B

1234567891011121314151617181920212223242526272829
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.EventSystems;
  5. public class TipInfoMsgManager : MonoBehaviour,IPointerEnterHandler,IPointerExitHandler
  6. {
  7. public string msg;
  8. public void OnPointerEnter(PointerEventData eventData)
  9. {
  10. if(ShowInfoTipManager.Instance)
  11. ShowInfoTipManager.Instance.showTip(msg,false);
  12. }
  13. public void OnPointerExit(PointerEventData eventData)
  14. {
  15. if (ShowInfoTipManager.Instance)
  16. ShowInfoTipManager.Instance.closeTip();
  17. }
  18. private void OnDisable()
  19. {
  20. if(ShowInfoTipManager.Instance)
  21. ShowInfoTipManager.Instance.closeTip();
  22. }
  23. }