简体   繁体   中英

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. 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[] . The device is ASUS Zenfone 2 which supports VR mode and I have been using it with older versions of Unity in VR mode.

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 is empty because you did not add it to the Editor yet. You mentioned Cardboard, so add Cardboard to the Virtual Reality SDKs list from the Player Settings .

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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