Framework_YooAsset_HybridCLR/Assets/DemoGame/GameScript/Hotfix/TestZhongLi.cs

30 lines
815 B
C#
Raw Normal View History

using UnityEngine;
namespace ZC
{
2024-07-19 10:52:40 +08:00
public class TestZhongLi : GameObjectBase<TestZhongLi>
{
2024-07-19 10:52:40 +08:00
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
{
2024-07-19 10:52:40 +08:00
// Debug.Log("没找到?");
}
}
}
}