24 lines
629 B
C#
24 lines
629 B
C#
|
using UnityEngine;
|
|||
|
|
|||
|
namespace ZC
|
|||
|
{
|
|||
|
public class TestZhongLi
|
|||
|
{
|
|||
|
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("没找到?");
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|