Example #1
0
 protected virtual void AttemptSecondaryGrab(VRTK_InteractableObject grabbableObject)
 {
     if (attemptSecondaryGrab)
     {
         SDK_BaseController.ControllerHand currentHand = VRTK_DeviceFinder.GetControllerHand(interactTouch.gameObject);
         VRTK_ControllerReference          oppositeControllerReference = VRTK_ControllerReference.GetControllerReference(VRTK_DeviceFinder.GetOppositeHand(currentHand));
         if (VRTK_ControllerReference.IsValid(oppositeControllerReference))
         {
             secondaryInteractTouch = (secondaryInteractTouch == null ? oppositeControllerReference.scriptAlias.GetComponentInChildren <VRTK_InteractTouch>() : secondaryInteractTouch);
             secondaryInteractGrab  = (secondaryInteractGrab == null ? oppositeControllerReference.scriptAlias.GetComponentInChildren <VRTK_InteractGrab>() : secondaryInteractGrab);
             secondaryInteractTouch.ForceStopTouching();
             secondaryInteractTouch.ForceTouch(grabbableObject.gameObject);
             secondaryInteractGrab.AttemptGrab();
         }
     }
 }