简体   繁体   English

Unity 5.6 VR VRSettings.supportedDevices为空

[英]Unity 5.6 VR VRSettings.supportedDevices is empty

I'm migrating my game to Unity 5.6 and trying to use the native VR support for Cardboard. 我正在将游戏迁移到Unity 5.6,并尝试对Cardboard使用本机VR支持。 However the pp doesn't go to VR mode at all I guess that's because when I call VRSettings.supportedDevices returns an empty string[] . 但是,pp根本不会进入VR模式,这是因为当我调用VRSettings.supportedDevices返回一个空string[] The device is ASUS Zenfone 2 which supports VR mode and I have been using it with older versions of Unity in VR mode. 该设备是支持VR模式的ASUS Zenfone 2,我一直在VR模式下将它与Unity的较早版本一起使用。

Anyone had this problem before? 有人遇到过这个问题吗?

Here is the code: 这是代码:

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);

}

VRSettings.supportedDevices returns a list of supported VR devices that were included at build time. VRSettings.supportedDevices返回构建时包含的受支持的VR设备的列表。

VRSettings.supportedDevices is empty because you did not add it to the Editor yet. VRSettings.supportedDevices为空,因为您尚未将其添加到编辑器中。 You mentioned Cardboard, so add Cardboard to the Virtual Reality SDKs list from the Player Settings . 您提到了Cardboard,所以将Cardboard从Player Settings中添加到Virtual Reality SDKs列表中。

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM