Enable/Disable VR from code
问题 How can I set the display to stereoscopic programmatically in Unity for an app deployed to an Android device? I want a UI menu where the user can toggle between \"VR mode\" and normal mode. I do not want VR mode by default as it should be an option at run-time. I know there is a setting for \"Virtual Reality Supported\" in the build settings, but again, I do not want this enabled by default. 回答1: Include using UnityEngine.XR; at the top. Call XRSettings.LoadDeviceByName("") with empty string