Class XRInputDeviceVector2ValueReader
A Scriptable
Inheritance
Inherited Members
Namespace: UnityEngine .XR.Interaction.Toolkit.Inputs.Readers
Assembly: Unity.XR.Interaction.Toolkit.dll
Syntax
[HelpURL("https://docs.unity3d.com/Packages/com.unity.xr.interaction.toolkit@3.1/api/UnityEngine.XR.Interaction.Toolkit.Inputs.Readers.XRInputDeviceVector2ValueReader.html")]
[CreateAssetMenu(fileName = "XRInputDeviceVector2ValueReader", menuName = "XR/Input Value Reader/Vector2")]
public class XRInputDeviceVector2ValueReader : XRInputDeviceValueReader<Vector2>, IXRInputValueReader<Vector2>, IXRInputValueReader
Methods
ReadValue()
Read the current value from the input source.
Declaration
public override Vector2 ReadValue()
Returns
Type | Description |
---|---|
Vector2 | Returns the current value from the input source. May return |
Overrides
TryReadValue(out Vector2)
Try to read the current value from the input source.
Declaration
public override bool TryReadValue(out Vector2 value)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | 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). |
Overrides
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 Vector2
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