private bool AttemptClick(VRTK_UIPointer pointer)
        {
            if (pointer.pointerEventData.pointerPress)
            {
                if (!ValidElement(pointer.pointerEventData.pointerPress))
                {
                    return(true);
                }

                if (pointer.pointerEventData.eligibleForClick)
                {
                    if (!IsHovering(pointer))
                    {
                        ExecuteEvents.ExecuteHierarchy(pointer.pointerEventData.pointerPress, pointer.pointerEventData, ExecuteEvents.pointerUpHandler);
                        pointer.pointerEventData.pointerPress = null;
                    }
                }
                else
                {
                    pointer.OnUIPointerElementClick(pointer.SetUIPointerEvent(pointer.pointerEventData.pointerPress));
                    ExecuteEvents.ExecuteHierarchy(pointer.pointerEventData.pointerPress, pointer.pointerEventData, ExecuteEvents.pointerClickHandler);
                    ExecuteEvents.ExecuteHierarchy(pointer.pointerEventData.pointerPress, pointer.pointerEventData, ExecuteEvents.pointerUpHandler);
                    pointer.pointerEventData.pointerPress = null;
                }
                return(true);
            }
            return(false);
        }
Exemple #2
0
 // Token: 0x0600176D RID: 5997 RVA: 0x0007D640 File Offset: 0x0007B840
 protected virtual bool AttemptClick(VRTK_UIPointer pointer)
 {
     if (!pointer.pointerEventData.pointerPress)
     {
         return(false);
     }
     if (!this.ValidElement(pointer.pointerEventData.pointerPress))
     {
         pointer.pointerEventData.pointerPress = null;
         return(true);
     }
     if (pointer.pointerEventData.eligibleForClick)
     {
         if (!this.IsHovering(pointer))
         {
             ExecuteEvents.ExecuteHierarchy <IPointerUpHandler>(pointer.pointerEventData.pointerPress, pointer.pointerEventData, ExecuteEvents.pointerUpHandler);
             pointer.pointerEventData.pointerPress = null;
         }
     }
     else
     {
         pointer.OnUIPointerElementClick(pointer.SetUIPointerEvent(pointer.pointerEventData.pointerPressRaycast, pointer.pointerEventData.pointerPress, null));
         ExecuteEvents.ExecuteHierarchy <IPointerClickHandler>(pointer.pointerEventData.pointerPress, pointer.pointerEventData, ExecuteEvents.pointerClickHandler);
         ExecuteEvents.ExecuteHierarchy <IPointerUpHandler>(pointer.pointerEventData.pointerPress, pointer.pointerEventData, ExecuteEvents.pointerUpHandler);
         pointer.pointerEventData.pointerPress = null;
     }
     return(true);
 }