Class ScreenSpaceSelectInput
Component that provides the select input for the ray interactor when using touchscreen with mobile AR. Intended to be used with an XRInputButtonReader as its object reference to provide the select input.
Inherited Members
Namespace: UnityEngine.XR.Interaction.Toolkit.AR.Inputs
Assembly: Unity.XR.Interaction.Toolkit.dll
Syntax
[AddComponentMenu("XR/Input/Screen Space Select Input", 11)]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.xr.interaction.toolkit@3.0/api/UnityEngine.XR.Interaction.Toolkit.AR.Inputs.ScreenSpaceSelectInput.html")]
[DefaultExecutionOrder(-30050)]
public class ScreenSpaceSelectInput : MonoBehaviour, IXRInputButtonReader, IXRInputValueReader<float>, IXRInputValueReader
Properties
dragCurrentPositionInput
Input to use for the screen drag current position.
Declaration
public XRInputValueReader<Vector2> dragCurrentPositionInput { get; set; }
Property Value
Type | Description |
---|---|
XRInputValueReader<Vector2> |
See Also
pinchGapDeltaInput
Input to use for the screen pinch gap delta relative to the previous frame.
Declaration
public XRInputValueReader<float> pinchGapDeltaInput { get; set; }
Property Value
Type | Description |
---|---|
XRInputValueReader<float> |
See Also
tapStartPositionInput
Input to use for the screen tap start position.
Declaration
public XRInputValueReader<Vector2> tapStartPositionInput { get; set; }
Property Value
Type | Description |
---|---|
XRInputValueReader<Vector2> |
See Also
twistDeltaRotationInput
Input to use for the screen twist delta relative to the previous frame.
Declaration
public XRInputValueReader<float> twistDeltaRotationInput { get; set; }
Property Value
Type | Description |
---|---|
XRInputValueReader<float> |
See Also
Methods
ReadIsPerformed()
Read whether the button is currently performed, which typically means whether the button is being pressed. This is typically true for multiple frames.
Declaration
public bool ReadIsPerformed()
Returns
Type | Description |
---|---|
bool | Returns true if the button is performed. Otherwise, returns false. |
Remarks
For input actions, this depends directly on the interaction(s) driving the action (including the default interaction if no specific interaction has been added to the action or binding).
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
ReadWasCompletedThisFrame()
Read whether the button completed this frame, which typically means whether the button stopped being pressed during this frame. This is typically only true for one single frame.
Declaration
public bool ReadWasCompletedThisFrame()
Returns
Type | Description |
---|---|
bool | Returns true if the button completed this frame. Otherwise, returns false. |
Remarks
For input actions, this depends directly on the interaction(s) driving the action (including the default interaction if no specific interaction has been added to the action or binding).
See Also
ReadWasPerformedThisFrame()
Read whether the button performed this frame, which typically means whether the button started being pressed during this frame. This is typically only true for one single frame.
Declaration
public bool ReadWasPerformedThisFrame()
Returns
Type | Description |
---|---|
bool | Returns true if the button performed this frame. Otherwise, returns false. |
Remarks
For input actions, this depends directly on the interaction(s) driving the action (including the default interaction if no specific interaction has been added to the action or binding).
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 ReadValue() in order to avoid doing
any work when the input action is not in progress, such as when the control is not actuated.
This can be useful for performance reasons.
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 ReadValue() instead of using the return value of this method to skip input handling.
See Also
Update()
See MonoBehaviour.
Declaration
protected void Update()