Unity Input.gyro.enabled在Android上引发空指针异常
我试着在安德里欧装置上使用统一的陀螺仪,它肯定有陀螺仪。但是,它使用空指针取消引用来保持SIGSEV'ng 来自墓碑:pid:8732,tid:8750,姓名:UnityMain>>Unity Input.gyro.enabled在Android上引发空指针异常,android,unity3d,Android,Unity3d,我试着在安德里欧装置上使用统一的陀螺仪,它肯定有陀螺仪。但是,它使用空指针取消引用来保持SIGSEV'ng 来自墓碑:pid:8732,tid:8750,姓名:UnityMain>> com.DefaultCompany.SIGV您是否尝试过(Input.isGyroAvailable)?@zambari没有,但我刚刚尝试过,它说Input.isGyroAvailable已贬值,我应该使用SystemInfo.supportsGyroscope:) private bool EnableGyro
com.DefaultCompany.SIGV您是否尝试过(Input.isGyroAvailable)?@zambari没有,但我刚刚尝试过,它说Input.isGyroAvailable已贬值,我应该使用SystemInfo.supportsGyroscope:)
private bool EnableGyro()
{
if (SystemInfo.supportsGyroscope)
{
//gyros = Input.gyro;
//gyros.enabled = true;
Input.gyro.enabled = true;
/*
cameraContainer.transform.rotation = Quaternion.Euler(90f, 90f, 0f);
rot = new Quaternion(0, 0, 1, 0);*/
return true;
}
return false;
}