/// <summary> /// Refreshes the parameters set by the Cardboard profile /// This method should be run whenever the Cardboard profile is updated and when /// the device orientation has changed. /// </summary> public static void RefreshParameters() { CardboardQrCode.RetrieveDeviceParam(); if (retrieving) { return; } retrieving = true; InitDeviceProfile(); InitCameraProperties(); retrieving = false; deviceParamsChangedEvent?.Invoke(); }
/// <summary> /// Initializes the Cardboard session /// </summary> public static void InitCardboard() { if (!initiated) { #if UNITY_ANDROID CardboardAndroidInitialization.InitAndroid(); #endif CardboardHeadTracker.CreateTracker(); CardboardHeadTracker.ResumeTracker(); CardboardQrCode.RegisterObserver(); Application.quitting += () => { CardboardQrCode.DeRegisterObserver(); }; initiated = true; } RefreshParameters(); }
/// <summary> /// Sets the cardboard profile ONLY when a cardboard QR code has not yet been scanned by camera. /// This behaviour is the same as the legacy cardboard gvr_set_default_viewer_profile /// </summary> /// <param name="url"></param> public static void SetCardboardInitialProfile(string url) { CardboardQrCode.SetCardboardInitialProfile(url); }
/// <summary> /// Brings up the QR code scanning intent to load a new profile /// </summary> public static void ScanQrCode() { CardboardQrCode.StartScanQrCode(); }