/// <summary> /// The GetActualController method will attempt to get the actual SDK controller object. /// </summary> /// <param name="givenController">The GameObject of the controller.</param> /// <returns>The GameObject that is the actual controller.</returns> public static GameObject GetActualController(GameObject givenController) { if (VRTK_SDK_Bridge.IsControllerLeftHand(givenController, true) || VRTK_SDK_Bridge.IsControllerRightHand(givenController, true)) { return(givenController); } if (VRTK_SDK_Bridge.IsControllerLeftHand(givenController, false)) { return(VRTK_SDK_Bridge.GetControllerLeftHand(true)); } if (VRTK_SDK_Bridge.IsControllerRightHand(givenController, false)) { return(VRTK_SDK_Bridge.GetControllerRightHand(true)); } return(null); }
// Token: 0x060016FA RID: 5882 RVA: 0x0007B44C File Offset: 0x0007964C private static GameObject GetValidObjectFromHand(SDK_BaseController.ControllerHand controllerHand) { if (controllerHand != SDK_BaseController.ControllerHand.Left) { if (controllerHand != SDK_BaseController.ControllerHand.Right) { return(null); } if (!VRTK_SDK_Bridge.GetControllerRightHand(false)) { return(VRTK_SDK_Bridge.GetControllerRightHand(true)); } return(VRTK_SDK_Bridge.GetControllerRightHand(false)); } else { if (!VRTK_SDK_Bridge.GetControllerLeftHand(false)) { return(VRTK_SDK_Bridge.GetControllerLeftHand(true)); } return(VRTK_SDK_Bridge.GetControllerLeftHand(false)); } }
/// <summary> /// The GetControllerLeftHand method retrieves the game object for the left hand controller. /// </summary> /// <param name="getActual">An optional parameter that if true will return the game object that the SDK controller is attached to.</param> /// <returns>The left hand controller.</returns> public static GameObject GetControllerLeftHand(bool getActual = false) { return(VRTK_SDK_Bridge.GetControllerLeftHand(getActual)); }
private static GameObject GetValidObjectFromHand(SDK_BaseController.ControllerHand controllerHand) { switch (controllerHand) { case SDK_BaseController.ControllerHand.Left: return(VRTK_SDK_Bridge.GetControllerLeftHand(false) ? VRTK_SDK_Bridge.GetControllerLeftHand(false) : VRTK_SDK_Bridge.GetControllerLeftHand(true)); case SDK_BaseController.ControllerHand.Right: return(VRTK_SDK_Bridge.GetControllerRightHand(false) ? VRTK_SDK_Bridge.GetControllerRightHand(false) : VRTK_SDK_Bridge.GetControllerRightHand(true)); } return(null); }
/// <summary> /// The GetControllerLeftHand method retrieves the game object for the left hand controller. /// </summary> /// <returns>The left hand controller.</returns> public static GameObject GetControllerLeftHand() { return(VRTK_SDK_Bridge.GetControllerLeftHand()); }