Version: 2022.2

Compass

class in UnityEngine

切换到手册

描述

进入罗盘功能的接口。

变量

enabled用于启用或禁用罗盘。注意,如果需要 Input.compass.trueHeading 属性包含有效值,还必须通过调用 Input.location.Start() 启用位置更新。
headingAccuracy航向读数(单位为度)的准确性。
magneticHeading相对于磁北极的航向(单位为度)。(只读)
rawVector测量的原始地磁数据(单位为微特斯拉)。(只读)
timestamp上次更新此航向的时间戳(自 1970 年起,单位为秒)。(只读)
trueHeading相对于地理北极的航向(单位为度)。(只读)