Ejemplo n.º 1
0
 async void IEndDragHandler.OnEndDrag(PointerEventData eventData)
 {
     canvasGroup.blocksRaycasts = true;
     if (active)
     {
         var raycast = new List <RaycastResult>();
         EventSystem.current.RaycastAll(eventData, raycast);
         var onDrop = raycast.Where(r => r.gameObject == zone.gameObject).Any();
         if (onDrop)
         {
             await interactive.Interact();
         }
     }
     PutBack(eventData);
     zone.StopDragging();
 }
Ejemplo n.º 2
0
        void IEndDragHandler.OnEndDrag(PointerEventData eventData)
        {
            eventData.selectedObject   = null;
            canvasGroup.blocksRaycasts = true;
            var raycast = new List <RaycastResult>();

            EventSystem.current.RaycastAll(eventData, raycast);
            var onDrop = raycast.Where(r => r.gameObject == zone.gameObject).Any();

            if (onDrop)
            {
                window.Pass();
            }
            PutBack();
            zone.StopDragging();
        }