Accessing VR SDK names by script?


I have an application that should build in GearVR, Cardboard or “Regular” mode on Android, for that I have an editor script that will switch the SDKs used depending on the choice (I don’t want to do it by hand, this has to be as easy to do as possible because I won’t be the only one to use it).

I am using this :

 string[] gearSDK = { "Oculus" };
UnityEditorInternal.VR.VREditor.SetVREnabledDevicesOnTargetGroup(UnityEditor.BuildTargetGroup.Android, gearSDK);

This works fine with the “Oculus” SDK but it doesn’t recognize my “Cardboard” sdk (which works fine if I am doing by hand). Is there a special string for the cardboard sdk, or another way to call them (because I assume that this string method is not the best)? I made sure it wasn’t just a typo, I have exactly the right name and yet it doesn’t find it.

Thanks in advance for the answers!

“cardboard” worked for me