我正在将我的游戏迁移到Unity 5.6,并尝试使用本地VR对Cardboard的支持。然而,pp根本不会进入VR模式,我猜这是因为当我调用VRSettings.supportedDevices时,会返回一个空的string[]。这款设备是华硕Zenfone 2,它支持VR模式,我一直在VR模式下的Unity旧版本上使用它。
以前有人遇到过这个问题吗?
代码如下:
IEnumerator LoadDevice(string newDevice)
{
VRSettings.LoadDeviceByName(newDevice);
yield return null;
VRSettings.enabled = true;
Debug.Log ("********************** SUPPORTED DEVICES 2: " + VRSettings.supportedDevices.Length);
Debug.Log ("********************** DEVICE: " + VRSettings.loadedDeviceName);
Debug.Log ("********************** ENABLED: " + VRSettings.enabled);
}发布于 2017-04-08 16:38:21
VRSettings.supportedDevices返回构建时包含的受支持VR设备的列表。
VRSettings.supportedDevices为空,因为您尚未将其添加到编辑器中。您提到了Cardboard,因此从播放器设置中将Cardboard添加到Virtual Reality SDK列表中。

https://stackoverflow.com/questions/43291834
复制相似问题