Class ScreenSpacePinchScaleInput
Component that provides the pinch gap delta scaling value from a touchscreen for mobile AR.
Intended to be used with an XRInput
Inherited Members
Namespace: UnityEngine .XR.Interaction.Toolkit.AR.Inputs
Assembly: Unity.XR.Interaction.Toolkit.dll
Syntax
[AddComponentMenu("XR/Input/Screen Space Pinch Scale Input", 11)]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.xr.interaction.toolkit@3.1/api/UnityEngine.XR.Interaction.Toolkit.AR.Inputs.ScreenSpacePinchScaleInput.html")]
public class ScreenSpacePinchScaleInput : MonoBehaviour, IXRInputValueReader<float>, IXRInputValueReader
Properties
pinchGapDeltaInput
The input used to read the pinch gap delta value.
Declaration
public XRInputValueReader<float> pinchGapDeltaInput { get; set; }
Property Value
Type | Description |
---|---|
XRInput |
See Also
rotationThreshold
The threshold at which a gestures will be interpreted only as rotation and not a pinch scale gesture.
Declaration
public float rotationThreshold { get; set; }
Property Value
Type | Description |
---|---|
float |
See Also
twistDeltaRotationInput
The input used to read the twist delta rotation value.
Declaration
public XRInputValueReader<float> twistDeltaRotationInput { get; set; }
Property Value
Type | Description |
---|---|
XRInput |
See Also
useRotationThreshold
Enables a rotation threshold that blocks pinch scale gestures when surpassed.
Declaration
public bool useRotationThreshold { get; set; }
Property Value
Type | Description |
---|---|
bool |
See Also
Methods
OnDisable()
See Mono
Declaration
protected void OnDisable()
See Also
OnEnable()
See Mono
Declaration
protected void OnEnable()
See Also
ReadValue()
Read the current value from the input source.
Declaration
public float ReadValue()
Returns
Type | Description |
---|---|
float | Returns the current value from the input source. May return |
See Also
TryReadValue(out float)
Try to read the current value from the input source.
Declaration
public bool TryReadValue(out float value)
Parameters
Type | Name | Description |
---|---|---|
float | value | When this method returns, contains the current value from the input source. May return |
Returns
Type | Description |
---|---|
bool | Returns true if the current value was able to be read (and for actions, also if in progress). |
Remarks
You can use the return value of this method instead of only using Read
If an input processor on an input action returns a different value from the default float
when the input action is not in progress, the outvalue
returned by
this method may not be default(TValue)
as is typically the case for Try
- methods. If you need
to support processors that return a different value from the default when the control is not actuated,
you should use Read