private void SetControllerListeners(GameObject controller)
 {
     if (controller && VRTK_SDK_Bridge.IsControllerLeftHand(controller))
     {
         ToggleControllerListeners(controller, leftController, ref leftSubscribed);
     }
     else if (controller && VRTK_SDK_Bridge.IsControllerRightHand(controller))
     {
         ToggleControllerListeners(controller, rightController, ref rightSubscribed);
     }
 }
Exemple #2
0
 // Token: 0x06001BA4 RID: 7076 RVA: 0x00090C05 File Offset: 0x0008EE05
 public static SDK_BaseController.ControllerHand GetControllerHand(GameObject controller)
 {
     if (VRTK_SDK_Bridge.IsControllerLeftHand(controller))
     {
         return(SDK_BaseController.ControllerHand.Left);
     }
     if (VRTK_SDK_Bridge.IsControllerRightHand(controller))
     {
         return(SDK_BaseController.ControllerHand.Right);
     }
     return(SDK_BaseController.ControllerHand.None);
 }
 private static SDK_BaseController.ControllerHand GetControllerHand(GameObject controllerObject)
 {
     if (VRTK_SDK_Bridge.IsControllerLeftHand(controllerObject, false) || VRTK_SDK_Bridge.IsControllerLeftHand(controllerObject, true))
     {
         return(SDK_BaseController.ControllerHand.Left);
     }
     else if (VRTK_SDK_Bridge.IsControllerRightHand(controllerObject, false) || VRTK_SDK_Bridge.IsControllerRightHand(controllerObject, true))
     {
         return(SDK_BaseController.ControllerHand.Right);
     }
     return(VRTK_SDK_Bridge.GetControllerModelHand(controllerObject));
 }
        public static bool IsControllerOfHand(GameObject checkController, ControllerHand hand)
        {
            if (hand == ControllerHand.Left && VRTK_SDK_Bridge.IsControllerLeftHand(checkController))
            {
                return(true);
            }

            if (hand == ControllerHand.Right && VRTK_SDK_Bridge.IsControllerRightHand(checkController))
            {
                return(true);
            }

            return(false);
        }
 public static ControllerHand GetControllerHand(GameObject controller)
 {
     if (VRTK_SDK_Bridge.IsControllerLeftHand(controller))
     {
         return(ControllerHand.Left);
     }
     else if (VRTK_SDK_Bridge.IsControllerRightHand(controller))
     {
         return(ControllerHand.Right);
     }
     else
     {
         return(ControllerHand.None);
     }
 }
Exemple #6
0
 // Token: 0x06001BAB RID: 7083 RVA: 0x00090C8E File Offset: 0x0008EE8E
 public static GameObject GetScriptAliasController(GameObject givenController)
 {
     if (VRTK_SDK_Bridge.IsControllerLeftHand(givenController, false) || VRTK_SDK_Bridge.IsControllerRightHand(givenController, false))
     {
         return(givenController);
     }
     if (VRTK_SDK_Bridge.IsControllerLeftHand(givenController, true))
     {
         return(VRTK_SDK_Bridge.GetControllerLeftHand(false));
     }
     if (VRTK_SDK_Bridge.IsControllerRightHand(givenController, true))
     {
         return(VRTK_SDK_Bridge.GetControllerRightHand(false));
     }
     return(null);
 }
 /// <summary>
 /// The IsControllerLeftHand method is used to check if a given controller game object is the left handed controller.
 /// </summary>
 /// <param name="checkController">The controller object that is being checked.</param>
 /// <returns>Is true if the given controller is the left controller.</returns>
 public static bool IsControllerLeftHand(GameObject checkController)
 {
     return(VRTK_SDK_Bridge.IsControllerLeftHand(checkController));
 }