GetStandardInteractionButton() 공개 메소드

Is the standard interaction button being pressed? In VR, this is a trigger press. In 2D fallback, this is a mouse left-click.
public GetStandardInteractionButton ( ) : bool
리턴 bool
	void OnHandHoverBegin( VRHand hand )
	{
		bool showHint = true;

		// "Catch" the throwable by holding down the interaction button instead of pressing it.
		// Only do this if the throwable is moving faster than the prescribed threshold speed,
		// and if it isn't attached to another hand
		if ( !attached )
		{
			if ( hand.GetStandardInteractionButton() )
			{
				Rigidbody rb = GetComponent<Rigidbody>();
				if ( rb.velocity.magnitude >= catchSpeedThreshold )
				{
					hand.AttachObject( gameObject, attachmentFlags, attachmentPoint );
					showHint = false;
				}
			}
		}

		if ( showHint )
		{
			VRControllerButtonHints.Show( hand, Valve.VR.EVRButtonId.k_EButton_SteamVR_Trigger );
		}
	}
예제 #2
0
    void OnHandHoverBegin(VRHand hand)
    {
        bool showHint = true;

        // "Catch" the throwable by holding down the interaction button instead of pressing it.
        // Only do this if the throwable is moving faster than the prescribed threshold speed,
        // and if it isn't attached to another hand
        if (!attached)
        {
            if (hand.GetStandardInteractionButton())
            {
                Rigidbody rb = GetComponent <Rigidbody>();
                if (rb.velocity.magnitude >= catchSpeedThreshold)
                {
                    hand.AttachObject(gameObject, attachmentFlags, attachmentPoint);
                    showHint = false;
                }
            }
        }

        if (showHint)
        {
            VRControllerButtonHints.Show(hand, Valve.VR.EVRButtonId.k_EButton_SteamVR_Trigger);
        }
    }
예제 #3
0
    private void Pulse()
    {
        if (hand && (hand.controller != null) && (hand.GetStandardInteractionButton()))
        {
            ushort duration = ( ushort )Random.Range(minimumPulseDuration, maximumPulseDuration + 1);
            hand.controller.TriggerHapticPulse(duration);

            onPulse.Invoke();
        }
    }
예제 #4
0
	void OnHandHoverBegin( VRHand hand )
	{
		// "Catch" the throwable by holding down the interaction button instead of pressing it.
		// Only do this if the throwable is moving faster than the prescribed threshold speed,
		// and if it isn't attached to another hand
		if ( !attached )
		{
			if ( hand.GetStandardInteractionButton() )
			{
				Rigidbody rb = GetComponent<Rigidbody>();
				if ( rb.velocity.magnitude >= catchSpeedThreshold )
				{
					hand.AttachObject( gameObject, snapOnAttach, attachmentPoint, detachOthers );
				}
			}
		}
	}
예제 #5
0
 void OnHandHoverBegin(VRHand hand)
 {
     // "Catch" the throwable by holding down the interaction button instead of pressing it.
     // Only do this if the throwable is moving faster than the prescribed threshold speed,
     // and if it isn't attached to another hand
     if (!attached)
     {
         if (hand.GetStandardInteractionButton())
         {
             Rigidbody rb = GetComponent <Rigidbody>();
             if (rb.velocity.magnitude >= catchSpeedThreshold)
             {
                 hand.AttachObject(gameObject, snapOnAttach, attachmentPoint, detachOthers);
             }
         }
     }
 }
예제 #6
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 );
        }
    }
예제 #7
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);
        }
    }
	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 );
		}
	}