定义用于从 XR.InputDevice.TryGetFeatureValue 中获取输入功能的静态变量。
使用这些静态变量可按使用情况获取 XR.InputDevice 的常用功能值。
batteryLevel | 表示设备的当前电池续航时间的值。 |
centerEyeAcceleration | 设备眼睛中心的加速度。 |
centerEyeAngularAcceleration | 设备眼睛中心的角加速度,采用欧拉角的格式。 |
centerEyeAngularVelocity | 设备眼睛中心的角速度,采用欧拉角的格式。 |
centerEyePosition | 设备眼睛中心的位置。 |
centerEyeRotation | 设备眼睛中心的旋转。 |
centerEyeVelocity | 设备眼睛中心的速度。 |
colorCameraAcceleration | 设备彩色摄像机的加速度。 |
colorCameraAngularAcceleration | 设备彩色摄像机的角加速度,采用欧拉角的格式。 |
colorCameraAngularVelocity | 设备彩色摄像机的角速度,采用欧拉角的格式。 |
colorCameraPosition | 设备彩色摄像机的位置。 |
colorCameraRotation | 设备彩色摄像机的旋转。 |
colorCameraVelocity | 设备彩色摄像机的速度。 |
deviceAcceleration | 设备的加速度。 |
deviceAngularAcceleration | 设备的角加速度,采用欧拉角的格式。 |
deviceAngularVelocity | 设备的角速度,采用欧拉角的格式。 |
devicePosition | 设备的位置。 |
deviceRotation | 设备的旋转。 |
deviceVelocity | 设备的速度。 |
eyesData | 包含从设备中收集的眼睛跟踪数据的眼睛结构。 |
grip | 表示控制器上的用户手柄。 |
gripButton | 表示设备是否被握住的二进制测量值。 |
handData | 表示设备的手柄数据的值。 |
isTracked | 告知开发人员当前是否在跟踪设备。 |
leftEyeAcceleration | 设备左眼的加速度。 |
leftEyeAngularAcceleration | 设备左眼的角加速度,采用欧拉角的格式。 |
leftEyeAngularVelocity | 设备左眼的角速度,采用欧拉角的格式。 |
leftEyePosition | 设备左眼的位置。 |
leftEyeRotation | 设备左眼的旋转。 |
leftEyeVelocity | 设备左眼的速度。 |
menuButton | 表示菜单按钮,用于暂停、返回或退出游戏。 |
primary2DAxis | 设备上的主触控板或游戏杆。 |
primary2DAxisClick | 表示被单击或按下的主 2D 轴。 |
primary2DAxisTouch | 表示被触摸的主 2D 轴。 |
primaryButton | 在设备上被按下的主要面按钮或唯一按钮(如果只有一个按钮可用)。 |
primaryTouch | 设备上被触摸的主要面按钮。 |
rightEyeAcceleration | 设备右眼的加速度。 |
rightEyeAngularAcceleration | 设备右眼的角加速度,采用欧拉角的格式。 |
rightEyeAngularVelocity | 设备右眼的角速度,采用欧拉角的格式。 |
rightEyePosition | 设备右眼的位置。 |
rightEyeRotation | 设备右眼的旋转。 |
rightEyeVelocity | 设备右眼的速度。 |
secondary2DAxis | 设备上的辅助触控板或游戏杆。 |
secondary2DAxisClick | 表示被单击或按下的辅助 2D 轴。 |
secondary2DAxisTouch | 表示被触摸的辅助 2D 轴。 |
secondaryButton | 设备上被按下的辅助面按钮。 |
secondaryTouch | 设备上被触摸的辅助面按钮。 |
trackingState | 表示正为此设备跟踪的值。 |
trigger | 触发式控制,用食指按下。 |
triggerButton | 表示食指是否正在激活触发器的二进制测量值。 |
userPresence | Use this property to test whether the user is currently wearing and/or interacting with the XR device. The exact behavior of this property varies with each type of device: some devices have a sensor specifically to detect user proximity, however you can reasonably infer that a user is present with the device when the property is UserPresenceState.Present. |
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.