public static void InitAndroid() { #if NATIVE_PLUGIN_EXIST AndroidJavaClass unityClass = new AndroidJavaClass(UNITY_ANDROID_PLAYER); AndroidJavaObject activityObject = unityClass.GetStatic <AndroidJavaObject>(UNITY_ANDROID_ACTIVITY_CURRENT); AndroidJavaObject contextObject = activityObject.Call <AndroidJavaObject>(UNITY_ANDROID_CONTEXT); CardboardUnity_initializeAndroid(activityObject.GetRawObject()); CardboardQrCode.SetAndroidQRCodeLocation(); #endif }
public static void InitCardboard() { if (!initiated) { CardboardHeadTracker.CreateTracker(); CardboardHeadTracker.ResumeTracker(); CardboardQrCode.RegisterObserver(); Application.quitting += ApplicationQuit; initiated = true; } RefreshParameters(); }
private static void InitDeviceProfile() { (IntPtr, int)par = CardboardQrCode.GetDeviceParamsPointer(); if (par.Item2 == 0 && !Application.isEditor) { profileAvailable = false; LoadDefaultProfile(); par = CardboardQrCode.GetDeviceParamsPointer(); } deviceParameter = CardboardQrCode.GetDecodedDeviceParams(); //todo do we need to destroy it before create it? CardboardLensDistortion.CreateLensDistortion(par.Item1, par.Item2); profileAvailable = true; }
private static void InitDeviceProfile() { (IntPtr, int)par = CardboardQrCode.GetDeviceParamsPointer(); if (par.Item2 == 0 && !Application.isEditor) { profileAvailable = false; CardboardQrCode.StartScanQrCode(); return; } //CardboardLensDistortion.DestroyLensDistortion(); deviceParameter = CardboardQrCode.GetDecodedDeviceParams(); CardboardLensDistortion.CreateLensDistortion(par.Item1, par.Item2); profileAvailable = true; }
public static void RefreshParameters() { CardboardQrCode.RetrieveDeviceParam(); if (retriving) { return; } retriving = true; InitDeviceProfile(); InitCameraProperties(); retriving = false; deviceParamsChangeEvent?.Invoke(); }
public static void InitCardboard() { if (!initiated) { #if UNITY_ANDROID CardboardAndroidInitialization.InitAndroid(); #endif CardboardHeadTracker.CreateTracker(); CardboardHeadTracker.ResumeTracker(); CardboardQrCode.RegisterObserver(); Application.quitting += ApplicationQuit; initiated = true; } RefreshParameters(); }
public static void ScanQrCode() { CardboardQrCode.StartScanQrCode(); }
//This function can be used to change current device paramters public static void SetCardboardProfile(string url) { CardboardQrCode.SetCardboardProfile(url); }
private static void ApplicationQuit() { CardboardQrCode.DeRegisterObserver(); }
private void ScanQRCode() { CardboardQrCode.StartScanQrCode(); SetEnableQROverlay(true); }