void FixedUpdate() { InputDevices.GetDevicesAtXRNode(role, devices); if (devices.Count > 0) { device = devices[0]; } if (device != null && device.isValid) { //Sets hand fingers wrap if (device.TryGetFeatureValue(XRHandControllerLink.GetCommonButton(button), out bool teleportButton)) { if (teleporting && !teleportButton) { hand.Teleport(); teleporting = false; } else if (!teleporting && teleportButton) { hand.StartTeleport(); teleporting = true; } } } }
private void OnDrawGizmosSelected() { if (controller == null && GetComponent <XRHandControllerLink>()) { controller = GetComponent <XRHandControllerLink>(); bendOffsets = new float[controller.hand.fingers.Length]; } }