private void OnDisable() { DestroyCollider(); InitHeadsetListeners(false); InitControllerListeners(VRTK_SDK_Bridge.GetControllerLeftHand(), false); InitControllerListeners(VRTK_SDK_Bridge.GetControllerRightHand(), false); }
private void InitListeners(bool state) { InitControllerListeners(VRTK_SDK_Bridge.GetControllerLeftHand(), state); InitControllerListeners(VRTK_SDK_Bridge.GetControllerRightHand(), state); InitTeleportListener(state); InitCollisionFadeListener(state); }
private void OnEnable() { CreateCollider(); lastGoodPositionSet = false; headset = VRTK_DeviceFinder.HeadsetTransform(); InitHeadsetListeners(true); InitControllerListeners(VRTK_SDK_Bridge.GetControllerLeftHand(), true); InitControllerListeners(VRTK_SDK_Bridge.GetControllerRightHand(), true); }
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); }
// Token: 0x06001364 RID: 4964 RVA: 0x0006C04A File Offset: 0x0006A24A public static GameObject GetControllerByHand(SDK_BaseController.ControllerHand hand, bool actual) { if (hand == SDK_BaseController.ControllerHand.Left) { return(VRTK_SDK_Bridge.GetControllerLeftHand(actual)); } if (hand != SDK_BaseController.ControllerHand.Right) { return(null); } return(VRTK_SDK_Bridge.GetControllerRightHand(actual)); }
private void InitDestinationMarkerListeners(bool state) { var leftHand = VRTK_SDK_Bridge.GetControllerLeftHand(); var rightHand = VRTK_SDK_Bridge.GetControllerRightHand(); InitDestinationSetListener(leftHand, state); InitDestinationSetListener(rightHand, state); foreach (var destinationMarker in VRTK_ObjectCache.registeredDestinationMarkers) { if (destinationMarker.gameObject != leftHand && destinationMarker.gameObject != rightHand) { InitDestinationSetListener(destinationMarker.gameObject, state); } } }
private void InitDestinationMarkerListeners(bool state) { var leftHand = VRTK_SDK_Bridge.GetControllerLeftHand(); var rightHand = VRTK_SDK_Bridge.GetControllerRightHand(); InitDestinationSetListener(leftHand, state); InitDestinationSetListener(rightHand, state); foreach (var destinationMarker in FindObjectsOfType <VRTK_DestinationMarker>()) { if (destinationMarker.gameObject != leftHand && destinationMarker.gameObject != rightHand) { InitDestinationSetListener(destinationMarker.gameObject, state); } } }
// 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); }
private void Awake() { if (GetComponent <VRTK_PlayerPresence>()) { playerPresence = GetComponent <VRTK_PlayerPresence>(); } else { Debug.LogError("The VRTK_TouchpadWalking script requires the VRTK_PlayerPresence script to be attached to the CameraRig"); return; } touchpadAxisChanged = new ControllerInteractionEventHandler(DoTouchpadAxisChanged); touchpadUntouched = new ControllerInteractionEventHandler(DoTouchpadTouchEnd); controllerLeftHand = VRTK_SDK_Bridge.GetControllerLeftHand(); controllerRightHand = VRTK_SDK_Bridge.GetControllerRightHand(); }
// 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 GetControllerRightHand method retrieves the game object for the right 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 right hand controller.</returns> public static GameObject GetControllerRightHand(bool getActual = false) { return(VRTK_SDK_Bridge.GetControllerRightHand(getActual)); }
/// <summary> /// The GetControllerRightHand method retrieves the game object for the right hand controller. /// </summary> /// <returns>The right hand controller.</returns> public static GameObject GetControllerRightHand() { return(VRTK_SDK_Bridge.GetControllerRightHand()); }