问题
There is a problem that the screen can not be divided during the card board test. I'm use versions for goolge sdk for unity 1.6 and Unity 5.6.2f1. in emulater(unity game scene),Game Scene does not split when playing. and console display "VRDevice cardboard not supported in Editor Mode. Please run on target device." but, Screen is split when testing on phone. What's the problem?
回答1:
Google VR SDK for Unity v1.50 (May 2017) or above have removed support for stereo preview in the unity editor. See release notes:
GvrViewerMain will be replaced by GvrEditorEmulator. The editor preview is now mono, not stereo, but will still support simulated headtracking.
回答2:
The "VRDevice cardboard not supported in Editor Mode. Please run on target device" console warning message simply indicates that the Unity editor currently doesn't provide the ability to emulate the "cardboard"
VRDevice provided by the Cardboard VR SDK in the editor.
For the most part, it's safe to ignore this warning. What it means is that even though you configured Cardboard as the first VR SDK (Player Settings > Android > XR Settings > Virtual Reality SDKs > Cardboard), Unity is effectively using None as the configured VR SDK.
Because of this, be aware that in the editor:
- XRSettings.loadedDeviceName will be
""
(meaning the None VR device) - XRSettings.enabled will be
false
- XRSettings.LoadDeviceByName("cardboard") will fail
Depending on the version of Unity you are using,
XRSettings
mentioned above may still be calledVRSettings
.In those versions Player Settings > Android > XR Settings > Virtual Reality SDKs can be found instead under: Player Settings > Android > Other Settings > Virtual Reality SDKs
If you're creating an app that you want to start in 2D instead of VR:
- Change Player Settings > Android > XR Settings > Virtual Reality SDKs to list the None device first, then add Cardboard as the second device. Because Unity tries VR SDKs in the order specified, this tells Unity to start your app in 2D.
- Follow https://github.com/googlevr/gvr-unity-sdk/wiki/Switching-between-VR-and-non-VR-at-runtime to switch to VR mode at runtime.
来源:https://stackoverflow.com/questions/44774254/unity-vrdevice-cardboard-not-supported-in-editor-mode-please-run-on-target-dev