private static void InitDeviceProfile()
        {
            (IntPtr, int)par = CardboardQrCode.GetDeviceParamsPointer();

            if (par.Item2 == 0 && !Application.isEditor)
            {
                profileAvailable = false;
                LoadDefaultProfile();
                par = CardboardQrCode.GetDeviceParamsPointer();
            }

            // if (par.Item2 == 0 && !Application.isEditor)
            // {
            //     CardboardQrCode.RetrieveCardboardDeviceV1Params();
            //     par = CardboardQrCode.GetDeviceParamsPointer();
            // }

            if (par.Item2 > 0 || Application.isEditor)
            {
                deviceParameter = CardboardQrCode.GetDecodedDeviceParams();
                //todo do we need to destroy it before create it?

                CardboardLensDistortion.CreateLensDistortion(par.Item1, par.Item2);
                profileAvailable = true;
            }
        }
예제 #2
0
        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;
        }