How to deactivate and activate Google Cardboard VR from script

How do I switch Google VR off and on again from script?

I’m using the Google VR SDK for Unity. I want my game to have VR mode if you have the glasses, but otherwise it’s a normal 3D game.

I have the VR working in editor mode and I see the stereoscopic view. Many similar questions advice to use Cardboard.SDK.VRModeEnabled = true/false, but MonoDevelop doesn’t recognize Cardboard.SDK in the namespace I’m in. If this is the way - how do I get Cardboard.SDK to work in Monodevelop? What’s the “using” I have to add? I’ve also tried setting VRSettings.enabled = false, but this doesn’t have any effect. If I disable the gameobject that has GvrViewer, Unity crashes.

You can disable the VR-mode by accessing the GvrView-script (either in the Google provided prefab or in the scene where you added it manually) and togging the bool VRModeEnabled to false on this script.