public static void DisableCardboardView()
 {
     if (CardboardManager.isCardboardViewOn)
     {
         CardboardManager.SetCardboardViewOn(false);
         Screen.orientation = instance.disabledOrientation;
     }
 }
 private void Update()
 {
     if (UseCardboardHeadTracker && CardboardManager.isCardboardViewOn)
     {
         Pose headPose = CardboardManager.GetHeadPose();
         CardboardHeadTracker.UpdatePose();
         transform.localPosition = headPose.position;
         transform.localRotation = headPose.rotation;
     }
 }
 private IEnumerator EnableCardboardViewCoroutine()
 {
     while (Screen.width < Screen.height && Screen.orientation != ScreenOrientation.LandscapeLeft)
     {
         Screen.orientation = ScreenOrientation.LandscapeLeft;
         yield return(new WaitForEndOfFrame());
     }
     CardboardManager.SetCardboardViewOn(true);
     CardboardManager.RefreshParameters();
 }
        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();

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

            leftCamera.targetTexture  = newLeft;
            rightCamera.targetTexture = newRight;

            CardboardManager.SetRenderTexture(newLeft, newRight);
        }
        private void Awake()
        {
            #if UNITY_IOS
            Application.targetFrameRate = 60;
            #endif

            mainCamera  = GetComponent <Camera>();
            leftCamera  = SpawnCamera(LEFT_CAMERA_NAME);
            rightCamera = SpawnCamera(RIGHT_CAMERA_NAME);

            SetupRenderTexture();

            CardboardManager.InitCardboard();
            CardboardManager.SetCardboardViewOn(false);
        }
 public static void StartScanQRCode()
 {
     CardboardManager.ScanQrCode();
 }
 private static void LoadDeviceParamCallback(bool success)
 {
     Debug.Log("LoadDeviceParamCallback called in Unity");
     CardboardManager.RefreshParameters();
 }