- Home /
Unity VR (XR) enable/disable VR on startup in Editor and as standalone.
Hi devs,
I have a game which supports both VR and non VR play mode. To start a game with or without VR support I run .exe with argument -vrmode None or -vrmode OpenVR.
In editor I have additional play buttons to start game in editor for VR or without. I use:
sdks[0] = noneVR;
sdks[1] = openVR;
PlayerSettings.SetVirtualRealitySDKs(BuildTargetGroup.Standalone, sdks);
Unity throws warnings that this method is obsolete:
'PlayerSettings.SetVirtualRealitySDKs(BuildTargetGroup, string[])' is obsolete: 'This API is obsolete, and should no longer be used. Please use XRManagerSettings in the XR Management package instead.'
How can I use new API, to decide VR/non-VR mode, before game runs in editor or standalone?
Answer by Zapan15 · Oct 09, 2020 at 05:37 PM
Please check this out: https://docs.unity3d.com/Manual/configuring-project-for-xr.html