Example #1
0
 private static VRSwitch GetInstance()
 {
     if (instance == null)
     {
         instance = FindObjectOfType <VRSwitch>();
     }
     return(instance);
 }
Example #2
0
    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
    }