Esempio n. 1
0
    /************************************    IEnumerator  *************************************/
    private IEnumerator OnResume()
    {
        for (int i = 0; i < 20; i++)
        {
            yield return(null);
        }
        EnterVRMode();
        Pvr_UnitySDKAPI.System.UPvr_StartHomeKeyReceiver(this.gameObject.name);
        if (pvr_UnitySDKSensor != null)
        {
            pvr_UnitySDKSensor.StartUnitySDKSensor();
            int iEnable6Dof = -1;
#if !UNITY_EDITOR && UNITY_ANDROID
            int iEnable6DofGlobalTracking = (int)GlobalIntConfigs.ENBLE_6DOF_GLOBAL_TRACKING;
            Render.UPvr_GetIntConfig(iEnable6DofGlobalTracking, ref iEnable6Dof);
#endif
            if (iEnable6Dof == 1)
            {
                pvr_UnitySDKSensor.OptionalResetUnitySDKSensor(0, 1);
            }
            else
            {
                pvr_UnitySDKSensor.ResetUnitySDKSensor();
            }
        }
    }
    /************************************    IEnumerator  *************************************/
    private IEnumerator OnResume()
    {
        if (!isViewerLogicFlow)
        {
            if (pvr_UnitySDKSensor != null)
            {
                pvr_UnitySDKSensor.StartUnitySDKSensor();

                int iEnable6Dof = -1;
#if !UNITY_EDITOR && UNITY_ANDROID
                int iEnable6DofGlobalTracking = (int)GlobalIntConfigs.ENBLE_6DOF_GLOBAL_TRACKING;
                Render.UPvr_GetIntConfig(iEnable6DofGlobalTracking, ref iEnable6Dof);
#endif
                if (iEnable6Dof != 1)
                {
                    int sensormode = -1;
#if !UNITY_EDITOR && UNITY_ANDROID
                    int isensormode = (int)GlobalIntConfigs.SensorMode;
                    Render.UPvr_GetIntConfig(isensormode, ref sensormode);
#endif

                    if (sensormode != 8)
                    {
                        pvr_UnitySDKSensor.ResetUnitySDKSensor();
                    }
                }
                if (HeadDofNum == HeadDofNum.SixDof)
                {
                    if (Sensor.Pvr_IsHead6dofReset() && ShowSafePanel)
                    {
                        safePanel1.SetActive(true);
                    }
                }
            }
        }
        bool setMonoPresentation = Pvr_UnitySDKAPI.System.UPvr_SetMonoPresentation();
        Debug.Log("onresume set monoPresentation success ?-------------" + setMonoPresentation.ToString());
        if (!setMonoPresentation)
        {
            Debug.LogError("SetMonoPresentation Error");
        }
        bool isPresentationExisted = Pvr_UnitySDKAPI.System.UPvr_IsPresentationExisted();
        Debug.Log("onresume presentation existed ?-------------" + isPresentationExisted.ToString());
        if (isPresentationExisted)
        {
            yield return(new WaitForSeconds(1.0f));
        }
        else
        {
            yield return(new WaitForSeconds(1.0f));
        }

        EnterVRMode();
        Pvr_UnitySDKAPI.System.UPvr_StartHomeKeyReceiver(this.gameObject.name);
        Pvr_UnitySDKEye.setLevel = false;
    }
Esempio n. 3
0
    /************************************    IEnumerator  *************************************/
    private IEnumerator OnResume()
    {
        if (!isViewerLogicFlow)
        {
            if (pvr_UnitySDKSensor != null)
            {
                pvr_UnitySDKSensor.StartUnitySDKSensor();

                int iEnable6Dof = -1;
#if !UNITY_EDITOR && UNITY_ANDROID
                int iEnable6DofGlobalTracking = (int)GlobalIntConfigs.ENBLE_6DOF_GLOBAL_TRACKING;
                Render.UPvr_GetIntConfig(iEnable6DofGlobalTracking, ref iEnable6Dof);
#endif
                if (iEnable6Dof != 1)
                {
                    int sensormode = -1;
#if !UNITY_EDITOR && UNITY_ANDROID
                    int isensormode = (int)GlobalIntConfigs.SensorMode;
                    Render.UPvr_GetIntConfig(isensormode, ref sensormode);
#endif

                    if (sensormode != 8)
                    {
                        pvr_UnitySDKSensor.ResetUnitySDKSensor();
                    }
                }
                if (HeadDofNum == HeadDofNum.SixDof)
                {
                    if (Sensor.Pvr_IsHead6dofReset() && ShowSafePanel)
                    {
                        safePanel1.SetActive(true);
                    }
                }
            }
        }

        if (mIsAndroid7)
        {
            Debug.Log("Android OS 7");
            for (int i = 0; i < 20; i++)
            {
                yield return(null);
            }
        }
        else
        {
            Debug.Log("Android OS ISNOT 7");
            yield return(null);
        }

        EnterVRMode();
        Pvr_UnitySDKAPI.System.UPvr_StartHomeKeyReceiver(this.gameObject.name);
        Pvr_UnitySDKEye.setLevel = false;
    }
Esempio n. 4
0
 /************************************    IEnumerator  *************************************/
 private IEnumerator OnResume()
 {
     for (int i = 0; i < 20; i++)
     {
         yield return(null);
     }
     EnterVRMode();
     if (pvr_UnitySDKSensor != null)
     {
         pvr_UnitySDKSensor.StartUnitySDKSensor();
         pvr_UnitySDKSensor.ResetUnitySDKSensor();
     }
 }