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 VRTK_ControllerReference GetControllerReference(GameObject controllerObject) { //Try and get the index from either the actual or alias uint controllerIndex = VRTK_SDK_Bridge.GetControllerIndex(controllerObject); //If not found then try and get index from the model object if (controllerIndex >= uint.MaxValue) { controllerIndex = VRTK_SDK_Bridge.GetControllerIndex(GetValidObjectFromHand(VRTK_SDK_Bridge.GetControllerModelHand(controllerObject))); } if (controllerReferences.ContainsKey(controllerIndex)) { return(controllerReferences[controllerIndex]); } return(new VRTK_ControllerReference(controllerIndex)); }
public static VRTK_ControllerReference GetControllerReference(GameObject controllerObject) { //Try and get the index from either the actual or alias uint controllerIndex = VRTK_SDK_Bridge.GetControllerIndex(controllerObject); //If not found then try and get index from the model object if (controllerIndex >= uint.MaxValue) { controllerIndex = VRTK_SDK_Bridge.GetControllerIndex(GetValidObjectFromHand(VRTK_SDK_Bridge.GetControllerModelHand(controllerObject))); } VRTK_ControllerReference foundReference = VRTK_SharedMethods.GetDictionaryValue(controllerReferences, controllerIndex); if (foundReference != null) { return(foundReference); } return(new VRTK_ControllerReference(controllerIndex)); }
// Token: 0x060016E7 RID: 5863 RVA: 0x0007B184 File Offset: 0x00079384 public static VRTK_ControllerReference GetControllerReference(GameObject controllerObject) { uint controllerIndex = VRTK_SDK_Bridge.GetControllerIndex(controllerObject); if (controllerIndex >= 4294967295U) { controllerIndex = VRTK_SDK_Bridge.GetControllerIndex(VRTK_ControllerReference.GetValidObjectFromHand(VRTK_SDK_Bridge.GetControllerModelHand(controllerObject))); } if (VRTK_ControllerReference.controllerReferences.ContainsKey(controllerIndex)) { return(VRTK_ControllerReference.controllerReferences[controllerIndex]); } return(new VRTK_ControllerReference(controllerIndex)); }