public virtual void Destroy() {
   if (device == this) {
     device = null;
   }
 }
    public static BaseVRDevice GetDevice() {
      if (device == null) {
#if UNITY_EDITOR
        device = new EditorDevice();
#elif ANDROID_DEVICE
        device = new AndroidDevice();
#elif IPHONE_DEVICE
        device = new iOSDevice();
#else
        // throw new InvalidOperationException("Unsupported device.");
        // For Emulator.
        device = new EditorDevice();
#endif
			}
      return device;
    }
Example #3
0
    public static BaseVRDevice GetDevice() {
      if (device == null) {
#if UNITY_EDITOR
        device = new EditorDevice();
#elif ANDROID_DEVICE
    #if UNITY_HAS_GOOGLEVR
        device = new UnityVRDevice();
    #else
        device = new AndroidDevice();
    #endif  // UNITY_HAS_GOOGLEVR
#elif IPHONE_DEVICE
        device = new iOSDevice();
#else
        throw new InvalidOperationException("Unsupported device.");
#endif  // UNITY_EDITOR
      }
      return device;
    }