CompassIconEventHandler.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.EventSystems;
  5. namespace CompassNavigatorPro {
  6. public class CompassIconEventHandler : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler, IPointerClickHandler, IPointerDownHandler, IPointerUpHandler {
  7. public CompassProPOI poi;
  8. public CompassPro compass;
  9. public void OnPointerEnter (PointerEventData eventData) {
  10. if (compass != null) {
  11. compass.BubbleEvent (compass.OnPOIMiniMapIconMouseEnter, poi);
  12. }
  13. }
  14. public void OnPointerExit (PointerEventData eventData) {
  15. if (compass != null) {
  16. compass.BubbleEvent (compass.OnPOIMiniMapIconMouseExit, poi);
  17. }
  18. }
  19. public void OnPointerClick (PointerEventData eventData) {
  20. if (compass != null) {
  21. compass.BubbleEvent (compass.OnPOIMiniMapIconMouseClick, poi);
  22. }
  23. }
  24. public void OnPointerDown (PointerEventData eventData) {
  25. if (compass != null) {
  26. compass.BubbleEvent (compass.OnPOIMiniMapIconMouseDown, poi);
  27. }
  28. }
  29. public void OnPointerUp (PointerEventData eventData) {
  30. if (compass != null) {
  31. compass.BubbleEvent (compass.OnPOIMiniMapIconMouseUp, poi);
  32. }
  33. }
  34. }
  35. }