//------------------------------------------------- private void HandHoverUpdate(Hand hand) { if (hand.GetStandardInteractionButtonDown()) { // Trigger was just pressed lastHandProjected = ComputeToTransformProjected(hand.hoverSphereTransform); if (hoverLock) { hand.HoverLock(GetComponent <Interactable>()); handHoverLocked = hand; } driving = true; ComputeAngle(hand); UpdateAll(); ControllerButtonHints.HideButtonHint(hand, EVRButtonId.k_EButton_SteamVR_Trigger); } else if (hand.GetStandardInteractionButtonUp()) { // Trigger was just released if (hoverLock) { hand.HoverUnlock(GetComponent <Interactable>()); handHoverLocked = null; } } else if (driving && hand.GetStandardInteractionButton() && hand.hoveringInteractable == GetComponent <Interactable>()) { ComputeAngle(hand); UpdateAll(); } }
//------------------------------------------------- private void HandHoverUpdate(Hand hand) { if (hand.GetStandardInteractionButtonDown()) { hand.HoverLock(GetComponent <Interactable>()); initialMappingOffset = linearMapping.value - CalculateLinearMapping(hand.transform); sampleCount = 0; mappingChangeRate = 0.0f; } if (hand.GetStandardInteractionButtonUp()) { hand.HoverUnlock(GetComponent <Interactable>()); CalculateMappingChangeRate(); } if (hand.GetStandardInteractionButton()) { UpdateLinearMapping(hand.transform); } }