private void Awake()
        {
            Application.targetFrameRate = CardboardUtility.GetTargetFramerate();

            if (dontDestroyAndSingleton)
            {
                if (_instance == null)
                {
                    DontDestroyOnLoad(gameObject);

                    _instance = this;
                }
                else if (_instance != this)
                {
                    Destroy(gameObject);

                    return;
                }
            }

            SetupRenderTexture();

            CardboardManager.InitCardboard();
            CardboardManager.SetVRViewEnable(defaultEnableVRView);
        }
        private void Awake()
        {
            #if UNITY_IOS
            Application.targetFrameRate = 60;
            #endif

            if (dontDestroyAndSingleton)
            {
                if (instance == null)
                {
                    DontDestroyOnLoad(gameObject);
                    instance = this;
                }
                else if (instance != this)
                {
                    Destroy(gameObject);
                    return;
                }
            }

            SetupRenderTexture();

            CardboardManager.InitCardboard();
            CardboardManager.SetVRViewEnable(defaultEnableVRView);
        }
Exemplo n.º 3
0
        private void Awake()
        {
            #if UNITY_IOS
            Application.targetFrameRate = 60;
            #endif

            SetupRenderTexture();

            CardboardManager.InitCardboard();
        }
        private static void QRCodeScannedCallback(bool success)
        {
            Debug.Log("QRCodeScannedCallback received in Unity!!");
            CardboardManager.RefreshParameters();

            if (GetQRCodeScanCount() > 0 && !PlayerPrefs.HasKey(CardboardUtility.KEY_CARDBOARD_CAMERA_SCANNED))
            {
                PlayerPrefs.SetInt(CardboardUtility.KEY_CARDBOARD_CAMERA_SCANNED, 1);
                PlayerPrefs.Save();
            }
        }
        private void SetupRenderTexture()
        {
            SetupEyeRenderTextureDescription();

            var newLeft  = new RenderTexture(_eyeRenderTextureDesc);
            var newRight = new RenderTexture(_eyeRenderTextureDesc);

            leftCam.targetTexture  = newLeft;
            rightCam.targetTexture = newRight;

            CardboardManager.SetRenderTexture(newLeft, newRight);
        }
Exemplo n.º 6
0
        private void SetupRenderTexture()
        {
            eyeRenderTextureDesc = new RenderTextureDescriptor()
            {
                dimension       = TextureDimension.Tex2D,
                width           = Screen.width / 2,
                height          = Screen.height,
                depthBufferBits = 16,
                volumeDepth     = 1,
                msaaSamples     = 1,
                vrUsage         = VRTextureUsage.OneEye
            };

            RenderTexture newLeft  = new RenderTexture(eyeRenderTextureDesc);
            RenderTexture newRight = new RenderTexture(eyeRenderTextureDesc);

            leftCam.targetTexture  = newLeft;
            rightCam.targetTexture = newRight;

            CardboardManager.SetRenderTexture(newLeft, newRight);
        }
Exemplo n.º 7
0
 private static void QRCodeScannedCallback()
 {
     Debug.Log("QRCodeScannedCallback received in Unity!!");
     CardboardManager.RefreshParameters();
 }
 private static void LoadDeviceParamCallback(bool success)
 {
     Debug.Log("LoadDeviceParamCallback called in Unity");
     CardboardManager.RefreshParameters();
 }
 private void CloseVRView()
 {
     CardboardManager.SetVRViewEnable(false);
 }
 private void SwitchVRView()
 {
     CardboardManager.SetVRViewEnable(!CardboardManager.enableVRView);
 }
 private void ScanQRCode()
 {
     CardboardManager.ScanQrCode();
     SetEnableQROverlay(true);
 }