GetStandardInteractionButtonDown() public method

Was the standard interaction button just pressed? In VR, this is a trigger press. In 2D fallback, this is a mouse left-click.
public GetStandardInteractionButtonDown ( ) : bool
return bool
	/// <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;
			}
		}
	}
Exemplo n.º 2
0
	//-----------------------------------------------------
	void HandHoverUpdate( VRHand hand )
	{
		if ( requireTriggerPress && hand.GetStandardInteractionButtonDown() )
		{
			SpawnAndAttachObject( hand );
		}
	}
Exemplo n.º 3
0
 //-----------------------------------------------------
 void HandHoverUpdate(VRHand hand)
 {
     if (requireTriggerPress && hand.GetStandardInteractionButtonDown())
     {
         SpawnAndAttachObject(hand);
     }
 }
Exemplo n.º 4
0
	void HandHoverUpdate( VRHand hand )
	{
		if ( hand.GetStandardInteractionButtonDown() )
		{
			VRInputModule.instance.Submit( gameObject );
		}
	}
Exemplo n.º 5
0
    /// <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;
            }
        }
    }
Exemplo n.º 6
0
 //-----------------------------------------------------
 void HandHoverUpdate(VRHand hand)
 {
     if (hand.GetStandardInteractionButtonDown())
     {
         PhysicsAttach(hand);
     }
 }
Exemplo n.º 7
0
 void HandHoverUpdate(VRHand hand)
 {
     if (hand.GetStandardInteractionButtonDown())
     {
         VRInputModule.instance.Submit(gameObject);
     }
 }
Exemplo n.º 8
0
	void HandHoverUpdate( VRHand hand )
	{
		//Trigger got pressed
		if ( hand.GetStandardInteractionButtonDown() )
		{
			hand.AttachObject( gameObject, snapOnAttach, attachmentPoint, detachOthers );
		}
	}
Exemplo n.º 9
0
 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 );
		}
	}
Exemplo n.º 11
0
 void HandHoverUpdate(VRHand hand)
 {
     //Trigger got pressed
     if (hand.GetStandardInteractionButtonDown())
     {
         hand.AttachObject(gameObject, attachmentFlags, attachmentPoint);
         VRControllerButtonHints.Hide(hand);
     }
 }
Exemplo n.º 12
0
    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 );
        }
    }
Exemplo n.º 13
0
    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 );
		}
	}
Exemplo n.º 15
0
    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);
        }
    }