Class XRInputDeviceButtonReader
An adapter component that provides a bool and float value from a device from the XR input subsystem as defined by its characteristics and feature usage string. Intended to be used with an XRInputButtonReader as its object reference.
Inherited Members
Namespace: UnityEngine.XR.Interaction.Toolkit.Inputs.Readers
Assembly: solution.dll
Syntax
[AddComponentMenu("XR/Input/XR Input Device Button Reader", 11)]
[HelpURL("https://docs.unity.cn/Packages/com.unity.xr.interaction.toolkit@3.0/api/UnityEngine.XR.Interaction.Toolkit.Inputs.Readers.XRInputDeviceButtonReader.html")]
[DefaultExecutionOrder(-31000)]
public sealed class XRInputDeviceButtonReader : MonoBehaviour, IXRInputButtonReader, IXRInputValueReader<float>, IXRInputValueReader
Properties
| Name | Description |
|---|---|
| boolValueReader | The value that is read to determine whether the button is down. |
| floatValueReader | The value that is read to determine the scalar value that varies from 0 to 1. |
Methods
| Name | Description |
|---|---|
| ReadIsPerformed() | Read whether the button is currently performed, which typically means whether the button is being pressed. This is typically true for multiple frames. |
| ReadValue() | Read the current value from the input source. |
| 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. |
| TryReadValue(out float) | Try to read the current value from the input source. |