private static VRSwitch GetInstance() { if (instance == null) { instance = FindObjectOfType <VRSwitch>(); } return(instance); }
void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } DontDestroyOnLoad(gameObject); supportedVRDevices = UnityEngine.XR.XRSettings.supportedDevices.ToList(); supportedVRDevices = supportedVRDevices.Where(dev => dev != "None").ToList(); supportedVRDevices.Add("None"); // The "None" device must be at the end }