var firstTime = true;
laya.device.motion.Gyroscope.instance.on(Event.CHANGE, this, onOrientationChange);
function onOrientationChange(absolute, info)
{
if (info.alpha === null)
{
addLog("当前设备不支持陀螺仪。");
return;
}
else if (firstTime && !absolute && !Browser.onIOS)
{
firstTime = false;
addLog("在当前设备中无法获取地球坐标系,使用设备坐标系,你可以继续观赏,但是提供的方位并非正确方位。");
}
addLog("Gyroscope " + Math.floor(info.alpha));
}