Version: 2021.3

InputDevice.characteristics

切换到手册
public XR.InputDeviceCharacteristics characteristics ;

描述

只读。用于描述 InputDevice 特征的枚举标志的位掩码。

Use Characteristics to determine whether an InputDevice has specific features or capabilities. For example, if the set of InputDeviceCharacteristics includes both InputDeviceCharacteristics.HeldInHand and InputDeviceCharacteristics.Left, then the device provides tracking data for the left hand.

Characteristics 是位掩码。使用按位运算符可测试特定标志。例如,要确定 InputDevice 是否具有摄像机,可使用下面的条件语句:

(inputDevice.characteristics & InputDeviceFlags.Camera) == InputDeviceFlags.Camera

Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961