public virtual void Destroy() { if (device == this) { device = null; } }
public static PicoVRBaseDevice GetDevice() { if (device == null) { #if UNITY_EDITOR if (PicoVRManager.SDK.IsVREditorDebug) { device = new PicoVRWinPCDevice(); } else { device = new PicoVRUnityDevice(); } #elif ANDROID_DEVICE device = new PicoVRAndroidDevice(); #elif IOS_DEVICE device = new PicoVRIOSDevice(); #elif UNITY_STANDALONE_WIN device = new PicoVRWinPCDevice(); #else throw new InvalidOperationException("Unsupported device."); #endif } return(device); }
/************************************ Process Interface *********************************/ #region Process Interface /// <summary> /// 初始化设备接口 /// </summary> private void InitDevice() { if (currentDevice != null) { currentDevice.Destroy(); } currentDevice = PicoVRBaseDevice.GetDevice(); }