public bool IsValidInteractableController(GameObject actualController, AllowedController controllerCheck) { if (controllerCheck == AllowedController.Both) { return(true); } var controllerHand = DeviceFinder.GetControllerHandType(controllerCheck.ToString().Replace("_Only", "")); return(DeviceFinder.IsControllerOfHand(actualController, controllerHand)); }
private Transform GetSnapHandle(VRTK_InteractableObject objectScript) { if (objectScript.rightSnapHandle == null && objectScript.leftSnapHandle != null) { objectScript.rightSnapHandle = objectScript.leftSnapHandle; } if (objectScript.leftSnapHandle == null && objectScript.rightSnapHandle != null) { objectScript.leftSnapHandle = objectScript.rightSnapHandle; } if (DeviceFinder.IsControllerOfHand(this.gameObject, DeviceFinder.ControllerHand.Right)) { return(objectScript.rightSnapHandle); } if (DeviceFinder.IsControllerOfHand(this.gameObject, DeviceFinder.ControllerHand.Left)) { return(objectScript.leftSnapHandle); } return(null); }