/// <summary> /// Called every Update() while a VRHand is hovering over me. /// </summary> /// <param name="hand"></param> void HandHoverUpdate( VRHand hand ) { if ( hand.GetStandardInteractionButtonDown() || ( ( hand.controller != null ) && hand.controller.GetPressDown( Valve.VR.EVRButtonId.k_EButton_Grip ) ) ) { if ( hand.currentAttachedObject != gameObject ) { // Save our position/rotation so that we can restore it when we detach oldPosition = transform.position; oldRotation = transform.rotation; // Call this to continue receiving HandHoverUpdate messages, // and prevent the hand from hovering over anything else hand.HoverLock( GetComponent<VRInteractable>() ); // Attach this object to the hand hand.AttachObject( gameObject, false ); } else { // Detach this object from the hand hand.DetachObject( gameObject ); // Call this to undo HoverLock hand.HoverUnlock( GetComponent<VRInteractable>() ); // Restore position/rotation transform.position = oldPosition; transform.rotation = oldRotation; } } }
//----------------------------------------------------- void HandHoverUpdate( VRHand hand ) { if ( requireTriggerPress && hand.GetStandardInteractionButtonDown() ) { SpawnAndAttachObject( hand ); } }
//----------------------------------------------------- void HandHoverUpdate(VRHand hand) { if (requireTriggerPress && hand.GetStandardInteractionButtonDown()) { SpawnAndAttachObject(hand); } }
void HandHoverUpdate( VRHand hand ) { if ( hand.GetStandardInteractionButtonDown() ) { VRInputModule.instance.Submit( gameObject ); } }
/// <summary> /// Called every Update() while a VRHand is hovering over me. /// </summary> /// <param name="hand"></param> void HandHoverUpdate(VRHand hand) { if (hand.GetStandardInteractionButtonDown() || ((hand.controller != null) && hand.controller.GetPressDown(Valve.VR.EVRButtonId.k_EButton_Grip))) { if (hand.currentAttachedObject != gameObject) { // Save our position/rotation so that we can restore it when we detach oldPosition = transform.position; oldRotation = transform.rotation; // Call this to continue receiving HandHoverUpdate messages, // and prevent the hand from hovering over anything else hand.HoverLock(GetComponent <VRInteractable>()); // Attach this object to the hand hand.AttachObject(gameObject, attachmentFlags); } else { // Detach this object from the hand hand.DetachObject(gameObject); // Call this to undo HoverLock hand.HoverUnlock(GetComponent <VRInteractable>()); // Restore position/rotation transform.position = oldPosition; transform.rotation = oldRotation; } } }
//----------------------------------------------------- void HandHoverUpdate(VRHand hand) { if (hand.GetStandardInteractionButtonDown()) { PhysicsAttach(hand); } }
void HandHoverUpdate(VRHand hand) { if (hand.GetStandardInteractionButtonDown()) { VRInputModule.instance.Submit(gameObject); } }
void HandHoverUpdate( VRHand hand ) { //Trigger got pressed if ( hand.GetStandardInteractionButtonDown() ) { hand.AttachObject( gameObject, snapOnAttach, attachmentPoint, detachOthers ); } }
void HandHoverUpdate(VRHand hand) { //Trigger got pressed if (hand.GetStandardInteractionButtonDown()) { hand.AttachObject(gameObject, snapOnAttach, attachmentPoint, detachOthers); } }
void HandHoverUpdate( VRHand hand ) { //Trigger got pressed if ( hand.GetStandardInteractionButtonDown() ) { hand.AttachObject( gameObject, attachmentFlags, attachmentPoint ); VRControllerButtonHints.Hide( hand ); } }
void HandHoverUpdate(VRHand hand) { //Trigger got pressed if (hand.GetStandardInteractionButtonDown()) { hand.AttachObject(gameObject, attachmentFlags, attachmentPoint); VRControllerButtonHints.Hide(hand); } }
void HandHoverUpdate( VRHand hand ) { if ( hand.currentAttachedObject ) return; if ( hand.GetStandardInteractionButtonDown() ) { hand.HoverLock( GetComponent<VRInteractable>() ); } if ( hand.GetStandardInteractionButtonUp() ) { hand.HoverUnlock( GetComponent<VRInteractable>() ); } if ( hand.GetStandardInteractionButton() ) { UpdateLinearMapping( hand.transform ); } }
void HandHoverUpdate(VRHand hand) { if (hand.currentAttachedObject) { return; } if (hand.GetStandardInteractionButtonDown()) { hand.HoverLock(GetComponent <VRInteractable>()); } if (hand.GetStandardInteractionButtonUp()) { hand.HoverUnlock(GetComponent <VRInteractable>()); } if (hand.GetStandardInteractionButton()) { UpdateLinearMapping(hand.transform); } }
void HandHoverUpdate( VRHand hand ) { if ( hand.GetStandardInteractionButtonDown() ) { hand.HoverLock( GetComponent<VRInteractable>() ); initialMappingOffset = linearMapping.value - CalculateLinearMapping( hand.transform ); sampleCount = 0; mappingChangeRate = 0.0f; } if ( hand.GetStandardInteractionButtonUp() ) { hand.HoverUnlock( GetComponent<VRInteractable>() ); CalculateMappingChangeRate(); } if ( hand.GetStandardInteractionButton() ) { UpdateLinearMapping( hand.transform ); } }
void HandHoverUpdate(VRHand hand) { if (hand.GetStandardInteractionButtonDown()) { hand.HoverLock(GetComponent <VRInteractable>()); initialMappingOffset = linearMapping.value - CalculateLinearMapping(hand.transform); sampleCount = 0; mappingChangeRate = 0.0f; } if (hand.GetStandardInteractionButtonUp()) { hand.HoverUnlock(GetComponent <VRInteractable>()); CalculateMappingChangeRate(); } if (hand.GetStandardInteractionButton()) { UpdateLinearMapping(hand.transform); } }