VRVIPMenuElement.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. using System;
  2. using UnityEngine;
  3. using UnityEngine.Events;
  4. using UnityEngine.EventSystems;
  5. public class VRVIPMenuElement : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler, IPointerClickHandler, IPointerDownHandler, IPointerUpHandler, IEventSystemHandler
  6. {
  7. public void OnPointerEnter(PointerEventData eventData)
  8. {
  9. if (this.m_CallbackPointerEnter != null)
  10. {
  11. this.m_CallbackPointerEnter();
  12. }
  13. }
  14. public void OnPointerExit(PointerEventData eventData)
  15. {
  16. if (this.m_CallbackPointerExit != null)
  17. {
  18. this.m_CallbackPointerExit();
  19. }
  20. }
  21. public void OnPointerClick(PointerEventData eventData)
  22. {
  23. if (this.m_CallbackPointerClick != null)
  24. {
  25. this.m_CallbackPointerClick();
  26. }
  27. }
  28. public void OnPointerDown(PointerEventData eventData)
  29. {
  30. if (this.m_CallbackPointerDown != null)
  31. {
  32. this.m_CallbackPointerDown();
  33. }
  34. }
  35. public void OnPointerUp(PointerEventData eventData)
  36. {
  37. if (this.m_CallbackPointerUp != null)
  38. {
  39. this.m_CallbackPointerUp();
  40. }
  41. }
  42. public UnityAction m_CallbackPointerEnter;
  43. public UnityAction m_CallbackPointerExit;
  44. public UnityAction m_CallbackPointerClick;
  45. public UnityAction m_CallbackPointerDown;
  46. public UnityAction m_CallbackPointerUp;
  47. }