No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

DragCallbackCheck.cs 1002B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using UnityEngine;
  2. using UnityEngine.EventSystems;
  3. public class DragCallbackCheck : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDragHandler, IDropHandler, IPointerDownHandler
  4. {
  5. private bool loggedOnDrag = false;
  6. public bool onBeginDragCalled = false;
  7. public bool onDragCalled = false;
  8. public bool onEndDragCalled = false;
  9. public bool onDropCalled = false;
  10. public void OnBeginDrag(PointerEventData eventData)
  11. {
  12. onBeginDragCalled = true;
  13. }
  14. public void OnDrag(PointerEventData eventData)
  15. {
  16. if (loggedOnDrag)
  17. return;
  18. loggedOnDrag = true;
  19. onDragCalled = true;
  20. }
  21. public void OnEndDrag(PointerEventData eventData)
  22. {
  23. onEndDragCalled = true;
  24. }
  25. public void OnDrop(PointerEventData eventData)
  26. {
  27. onDropCalled = true;
  28. }
  29. public void OnPointerDown(PointerEventData eventData)
  30. {
  31. // Empty to ensure we get the drop if we have a pointer handle as well.
  32. }
  33. }