TryGetFeatureValue
Retrieves information about the input feature specified by the Usage parameter. Those functions which take a time parameter allow querying for that feature at a particular point in time
阅读时间12 分钟最后更新于 11 天前
Definition
- Type: Method
- Namespace: UnityEngine.XR
- Assembly: UnityEngine.XRModule
TryGetFeatureValue(InputFeatureUsage<bool>, bool)
Retrieves information about the input feature specified by the Usage parameter. Those functions which take a time parameter allow querying for that feature at a particular point in time
public bool TryGetFeatureValue(InputFeatureUsage<bool> usage, out bool value)
Parameters
Usage that describes the feature to retrieve.
A variable of the appropriate type to receive the information about the feature.
Returns
Type | Description |
|---|---|
| bool | True if the feature information is retrieved; otherwise false. |
Remarks
See XR.InputDevice.CommonUsages for valid usages that can be used to retrieve input values. Note: not all of these features will be available on all devices. If a feature is not available this function will return false.
TryGetFeatureValue(InputFeatureUsage<uint>, uint)
Retrieves information about the input feature specified by the Usage parameter. Those functions which take a time parameter allow querying for that feature at a particular point in time
public bool TryGetFeatureValue(InputFeatureUsage<uint> usage, out uint value)
Parameters
Usage that describes the feature to retrieve.
A variable of the appropriate type to receive the information about the feature.
Returns
Type | Description |
|---|---|
| bool | True if the feature information is retrieved; otherwise false. |
Remarks
See XR.InputDevice.CommonUsages for valid usages that can be used to retrieve input values. Note: not all of these features will be available on all devices. If a feature is not available this function will return false.
TryGetFeatureValue(InputFeatureUsage<float>, float)
Retrieves information about the input feature specified by the Usage parameter. Those functions which take a time parameter allow querying for that feature at a particular point in time
public bool TryGetFeatureValue(InputFeatureUsage<float> usage, out float value)
Parameters
Usage that describes the feature to retrieve.
A variable of the appropriate type to receive the information about the feature.
Returns
Type | Description |
|---|---|
| bool | True if the feature information is retrieved; otherwise false. |
Remarks
See XR.InputDevice.CommonUsages for valid usages that can be used to retrieve input values. Note: not all of these features will be available on all devices. If a feature is not available this function will return false.
TryGetFeatureValue(InputFeatureUsage<Vector2>, Vector2)
Retrieves information about the input feature specified by the Usage parameter. Those functions which take a time parameter allow querying for that feature at a particular point in time
public bool TryGetFeatureValue(InputFeatureUsage<Vector2> usage, out Vector2 value)
Parameters
Usage that describes the feature to retrieve.
A variable of the appropriate type to receive the information about the feature.
Returns
Type | Description |
|---|---|
| bool | True if the feature information is retrieved; otherwise false. |
Remarks
See XR.InputDevice.CommonUsages for valid usages that can be used to retrieve input values. Note: not all of these features will be available on all devices. If a feature is not available this function will return false.
TryGetFeatureValue(InputFeatureUsage<Vector3>, Vector3)
Retrieves information about the input feature specified by the Usage parameter. Those functions which take a time parameter allow querying for that feature at a particular point in time
public bool TryGetFeatureValue(InputFeatureUsage<Vector3> usage, out Vector3 value)
Parameters
Usage that describes the feature to retrieve.
A variable of the appropriate type to receive the information about the feature.
Returns
Type | Description |
|---|---|
| bool | True if the feature information is retrieved; otherwise false. |
Remarks
See XR.InputDevice.CommonUsages for valid usages that can be used to retrieve input values. Note: not all of these features will be available on all devices. If a feature is not available this function will return false.
TryGetFeatureValue(InputFeatureUsage<Quaternion>, Quaternion)
Retrieves information about the input feature specified by the Usage parameter. Those functions which take a time parameter allow querying for that feature at a particular point in time
public bool TryGetFeatureValue(InputFeatureUsage<Quaternion> usage, out Quaternion value)
Parameters
Usage that describes the feature to retrieve.
A variable of the appropriate type to receive the information about the feature.
Returns
Type | Description |
|---|---|
| bool | True if the feature information is retrieved; otherwise false. |
Remarks
See XR.InputDevice.CommonUsages for valid usages that can be used to retrieve input values. Note: not all of these features will be available on all devices. If a feature is not available this function will return false.
TryGetFeatureValue(InputFeatureUsage<Hand>, Hand)
Retrieves information about the input feature specified by the Usage parameter. Those functions which take a time parameter allow querying for that feature at a particular point in time
public bool TryGetFeatureValue(InputFeatureUsage<Hand> usage, out Hand value)
Parameters
Usage that describes the feature to retrieve.
A variable of the appropriate type to receive the information about the feature.
Returns
Type | Description |
|---|---|
| bool | True if the feature information is retrieved; otherwise false. |
Remarks
See XR.InputDevice.CommonUsages for valid usages that can be used to retrieve input values. Note: not all of these features will be available on all devices. If a feature is not available this function will return false.
TryGetFeatureValue(InputFeatureUsage<Bone>, Bone)
Retrieves information about the input feature specified by the Usage parameter. Those functions which take a time parameter allow querying for that feature at a particular point in time
public bool TryGetFeatureValue(InputFeatureUsage<Bone> usage, out Bone value)
Parameters
Usage that describes the feature to retrieve.
A variable of the appropriate type to receive the information about the feature.
Returns
Type | Description |
|---|---|
| bool | True if the feature information is retrieved; otherwise false. |
Remarks
See XR.InputDevice.CommonUsages for valid usages that can be used to retrieve input values. Note: not all of these features will be available on all devices. If a feature is not available this function will return false.
TryGetFeatureValue(InputFeatureUsage<Eyes>, Eyes)
Retrieves information about the input feature specified by the Usage parameter. Those functions which take a time parameter allow querying for that feature at a particular point in time
public bool TryGetFeatureValue(InputFeatureUsage<Eyes> usage, out Eyes value)
Parameters
Usage that describes the feature to retrieve.
A variable of the appropriate type to receive the information about the feature.
Returns
Type | Description |
|---|---|
| bool | True if the feature information is retrieved; otherwise false. |
Remarks
See XR.InputDevice.CommonUsages for valid usages that can be used to retrieve input values. Note: not all of these features will be available on all devices. If a feature is not available this function will return false.
TryGetFeatureValue(InputFeatureUsage<byte[]>, byte[])
Obtains the value of a custom input feature as raw bytes.
public bool TryGetFeatureValue(InputFeatureUsage<byte[]> usage, byte[] value)
Parameters
The usage that identifies the input feature to read.
The byte array that the method fills with the feature data.
Returns
Type | Description |
|---|---|
| bool | True if the method retrieves the feature data. Otherwise, false. |
Remarks
Use this overload to read an input feature that a provider exposes as custom data. To find these features, call InputDevice.TryGetFeatureUsages and look for usages whose property is . The method copies the feature data into the array that you pass in, so allocate the array before you call the method. Size the array to fit the feature data, which the provider defines. Not every device supports every feature. If the array is too small, the method copies only the bytes that fit and still returns .
typebyte[]trueTryGetFeatureValue(InputFeatureUsage<InputTrackingState>, InputTrackingState)
Retrieves information about the input feature specified by the Usage parameter. Those functions which take a time parameter allow querying for that feature at a particular point in time
public bool TryGetFeatureValue(InputFeatureUsage<InputTrackingState> usage, out InputTrackingState value)
Parameters
Usage that describes the feature to retrieve.
A variable of the appropriate type to receive the information about the feature.
Returns
Type | Description |
|---|---|
| bool | True if the feature information is retrieved; otherwise false. |
Remarks
See XR.InputDevice.CommonUsages for valid usages that can be used to retrieve input values. Note: not all of these features will be available on all devices. If a feature is not available this function will return false.
TryGetFeatureValue(InputFeatureUsage<bool>, DateTime, bool)
Retrieves information about the input feature specified by the Usage parameter. Those functions which take a time parameter allow querying for that feature at a particular point in time
public bool TryGetFeatureValue(InputFeatureUsage<bool> usage, DateTime time, out bool value)
Parameters
Usage that describes the feature to retrieve.
A DateTime struct with the local time at which to query for data.
A variable of the appropriate type to receive the information about the feature.
Returns
Type | Description |
|---|---|
| bool | True if the feature information is retrieved; otherwise false. |
Remarks
See XR.InputDevice.CommonUsages for valid usages that can be used to retrieve input values. Note: not all of these features will be available on all devices. If a feature is not available this function will return false.
TryGetFeatureValue(InputFeatureUsage<uint>, DateTime, uint)
Retrieves information about the input feature specified by the Usage parameter. Those functions which take a time parameter allow querying for that feature at a particular point in time
public bool TryGetFeatureValue(InputFeatureUsage<uint> usage, DateTime time, out uint value)
Parameters
Usage that describes the feature to retrieve.
A DateTime struct with the local time at which to query for data.
A variable of the appropriate type to receive the information about the feature.
Returns
Type | Description |
|---|---|
| bool | True if the feature information is retrieved; otherwise false. |
Remarks
See XR.InputDevice.CommonUsages for valid usages that can be used to retrieve input values. Note: not all of these features will be available on all devices. If a feature is not available this function will return false.
TryGetFeatureValue(InputFeatureUsage<float>, DateTime, float)
Retrieves information about the input feature specified by the Usage parameter. Those functions which take a time parameter allow querying for that feature at a particular point in time
public bool TryGetFeatureValue(InputFeatureUsage<float> usage, DateTime time, out float value)
Parameters
Usage that describes the feature to retrieve.
A DateTime struct with the local time at which to query for data.
A variable of the appropriate type to receive the information about the feature.
Returns
Type | Description |
|---|---|
| bool | True if the feature information is retrieved; otherwise false. |
Remarks
See XR.InputDevice.CommonUsages for valid usages that can be used to retrieve input values. Note: not all of these features will be available on all devices. If a feature is not available this function will return false.
TryGetFeatureValue(InputFeatureUsage<Vector2>, DateTime, Vector2)
Retrieves information about the input feature specified by the Usage parameter. Those functions which take a time parameter allow querying for that feature at a particular point in time
public bool TryGetFeatureValue(InputFeatureUsage<Vector2> usage, DateTime time, out Vector2 value)
Parameters
Usage that describes the feature to retrieve.
A DateTime struct with the local time at which to query for data.
A variable of the appropriate type to receive the information about the feature.
Returns
Type | Description |
|---|---|
| bool | True if the feature information is retrieved; otherwise false. |
Remarks
See XR.InputDevice.CommonUsages for valid usages that can be used to retrieve input values. Note: not all of these features will be available on all devices. If a feature is not available this function will return false.
TryGetFeatureValue(InputFeatureUsage<Vector3>, DateTime, Vector3)
Retrieves information about the input feature specified by the Usage parameter. Those functions which take a time parameter allow querying for that feature at a particular point in time
public bool TryGetFeatureValue(InputFeatureUsage<Vector3> usage, DateTime time, out Vector3 value)
Parameters
Usage that describes the feature to retrieve.
A DateTime struct with the local time at which to query for data.
A variable of the appropriate type to receive the information about the feature.
Returns
Type | Description |
|---|---|
| bool | True if the feature information is retrieved; otherwise false. |
Remarks
See XR.InputDevice.CommonUsages for valid usages that can be used to retrieve input values. Note: not all of these features will be available on all devices. If a feature is not available this function will return false.
TryGetFeatureValue(InputFeatureUsage<Quaternion>, DateTime, Quaternion)
Retrieves information about the input feature specified by the Usage parameter. Those functions which take a time parameter allow querying for that feature at a particular point in time
public bool TryGetFeatureValue(InputFeatureUsage<Quaternion> usage, DateTime time, out Quaternion value)
Parameters
Usage that describes the feature to retrieve.
A DateTime struct with the local time at which to query for data.
A variable of the appropriate type to receive the information about the feature.
Returns
Type | Description |
|---|---|
| bool | True if the feature information is retrieved; otherwise false. |
Remarks
See XR.InputDevice.CommonUsages for valid usages that can be used to retrieve input values. Note: not all of these features will be available on all devices. If a feature is not available this function will return false.
TryGetFeatureValue(InputFeatureUsage<InputTrackingState>, DateTime, InputTrackingState)
Retrieves information about the input feature specified by the Usage parameter. Those functions which take a time parameter allow querying for that feature at a particular point in time
public bool TryGetFeatureValue(InputFeatureUsage<InputTrackingState> usage, DateTime time, out InputTrackingState value)
Parameters
Usage that describes the feature to retrieve.
A DateTime struct with the local time at which to query for data.
A variable of the appropriate type to receive the information about the feature.
Returns
Type | Description |
|---|---|
| bool | True if the feature information is retrieved; otherwise false. |
Remarks
See XR.InputDevice.CommonUsages for valid usages that can be used to retrieve input values. Note: not all of these features will be available on all devices. If a feature is not available this function will return false.