30 lines
815 B
C#
30 lines
815 B
C#
using UnityEngine;
|
|
|
|
namespace ZC
|
|
{
|
|
public class TestZhongLi : GameObjectBase<TestZhongLi>
|
|
{
|
|
public override void OnUpdate(float dateTime)
|
|
{
|
|
base.OnUpdate(dateTime);
|
|
Debug.Log("没找到?");
|
|
}
|
|
|
|
public void Update()
|
|
{
|
|
if (SystemInfo.supportsGyroscope)
|
|
{
|
|
var gyro = Input.gyro;
|
|
gyro.enabled = true;
|
|
Debug.Log($"{gyro.rotationRate} , {gyro.attitude}");
|
|
// Camera.main.transform.Rotate(gyro.rotationRate);
|
|
Camera.main.transform.rotation = gyro.attitude;
|
|
Debug.Log($"raw: {Input.compass.rawVector}");
|
|
}
|
|
else
|
|
{
|
|
// Debug.Log("没找到?");
|
|
}
|
|
}
|
|
}
|
|
} |