Esempio n. 1
0
    /// @endcond

    private void InitDevice()
    {
        // 1.3.0 -- 初始化设备
        if (device != null)
        {
            device.Destroy();
        }
        // 获取设备
        device = BaseVRDevice.GetDevice();
        // 设备初始化,这是继承类,其中override重新了Init。参考下图
        device.Init();

        List <string> diagnostics = new List <string>();

        NativeUILayerSupported = device.SupportsNativeUILayer(diagnostics);
        if (diagnostics.Count > 0)
        {
            Debug.LogWarning("Built-in UI layer disabled. Causes: ["
                             + String.Join("; ", diagnostics.ToArray()) + "]");
        }

        if (DefaultDeviceProfile != null)
        {
            device.SetDefaultDeviceProfile(DefaultDeviceProfile);
        }

        device.SetNeckModelScale(neckModelScale);

#if !UNITY_HAS_GOOGLEVR || UNITY_EDITOR
        device.SetVRModeEnabled(vrModeEnabled);
#endif  // !UNITY_HAS_GOOGLEVR || UNITY_EDITOR

        device.UpdateScreenData();
    }
Esempio n. 2
0
    /// @endcond

    private void InitDevice()
    {
        if (device != null)
        {
            device.Destroy();
        }
        device = BaseVRDevice.GetDevice();
        device.Init();

        List <string> diagnostics = new List <string>();

        NativeUILayerSupported = device.SupportsNativeUILayer(diagnostics);
        if (diagnostics.Count > 0)
        {
            Debug.LogWarning("Built-in UI layer disabled. Causes: ["
                             + String.Join("; ", diagnostics.ToArray()) + "]");
        }

        if (DefaultDeviceProfile != null)
        {
            device.SetDefaultDeviceProfile(DefaultDeviceProfile);
        }

        device.SetNeckModelScale(neckModelScale);

        device.SetVRModeEnabled(vrModeEnabled);

        device.UpdateScreenData();
    }
    /// @endcond

    private void InitDevice()
    {
        if (device != null)
        {
            device.Destroy();
        }
        Svr.SvrLog.Log("InitDevice");
        SVR.AtwAPI.BeginTrace("init");
        device = BaseVRDevice.GetDevice();
        SVR.AtwAPI.EndTrace();
        if (Svr.SvrSetting.IsVR9Device)
        {
            return;
        }
        device.Init();


        SVR.AtwAPI.BeginTrace("other");
        List <string> diagnostics = new List <string>();

        NativeDistortionCorrectionSupported = device.SupportsNativeDistortionCorrection(diagnostics);
        if (diagnostics.Count > 0)
        {
            Debug.LogWarning("Built-in distortion correction disabled. Causes: ["
                             + String.Join("; ", diagnostics.ToArray()) + "]");
        }
        diagnostics.Clear();
        NativeUILayerSupported = device.SupportsNativeUILayer(diagnostics);
        if (diagnostics.Count > 0)
        {
            Debug.LogWarning("Built-in UI layer disabled. Causes: ["
                             + String.Join("; ", diagnostics.ToArray()) + "]");
        }

        if (DefaultDeviceProfile != null)
        {
            device.SetDefaultDeviceProfile(DefaultDeviceProfile);
        }

        device.SetDistortionCorrectionEnabled(distortionCorrection == DistortionCorrectionMethod.Native &&
                                              NativeDistortionCorrectionSupported);
        device.SetNeckModelScale(neckModelScale);

#if !UNITY_HAS_GOOGLEVR || UNITY_EDITOR
        device.SetVRModeEnabled(vrModeEnabled);
#endif  // !UNITY_HAS_GOOGLEVR || UNITY_EDITOR
        SVR.AtwAPI.EndTrace();
        SVR.AtwAPI.BeginTrace("updatedata");
        device.UpdateScreenData();
        SVR.AtwAPI.EndTrace();
    }
Esempio n. 4
0
    /// @endcond

    private void InitDevice()
    {
        if (device != null)
        {
            device.Destroy();
        }
        // 根据当前运行场景获取对应的设备对象
        device = BaseVRDevice.GetDevice();
        device.Init();

        device.SetVRModeEnabled(vrModeEnabled);
        // 更新界面数据
        device.UpdateScreenData();

        GazeApi(GazeTag.Show, "");
        GazeApi(GazeTag.Set_Size, ((int)GazeSize.Original).ToString());
    }
Esempio n. 5
0
    /// @endcond

    private void InitDevice()
    {
        if (device != null)
        {
            device.Destroy();
        }
        device = BaseVRDevice.GetDevice();
        device.Init();

        List <string> diagnostics = new List <string>();

        NativeDistortionCorrectionSupported = device.SupportsNativeDistortionCorrection(diagnostics);
        if (diagnostics.Count > 0)
        {
            Debug.LogWarning("Built-in distortion correction disabled. Causes: ["
                             + String.Join("; ", diagnostics.ToArray()) + "]");
        }
        diagnostics.Clear();
        NativeUILayerSupported = device.SupportsNativeUILayer(diagnostics);
        if (diagnostics.Count > 0)
        {
            Debug.LogWarning("Built-in UI layer disabled. Causes: ["
                             + String.Join("; ", diagnostics.ToArray()) + "]");
        }

        if (DefaultDeviceProfile != null)
        {
            device.SetDefaultDeviceProfile(DefaultDeviceProfile);
        }

        device.SetAlignmentMarkerEnabled(enableAlignmentMarker);
        device.SetSettingsButtonEnabled(enableSettingsButton);
        device.SetVRBackButtonEnabled(backButtonMode != BackButtonModes.Off);
        device.SetShowVrBackButtonOnlyInVR(backButtonMode == BackButtonModes.OnlyInVR);
        device.SetDistortionCorrectionEnabled(distortionCorrection == DistortionCorrectionMethod.Native &&
                                              NativeDistortionCorrectionSupported);
        device.SetTapIsTrigger(tapIsTrigger);
        device.SetNeckModelScale(neckModelScale);
        device.SetAutoDriftCorrectionEnabled(autoDriftCorrection);
        device.SetElectronicDisplayStabilizationEnabled(electronicDisplayStabilization);

        device.SetVRModeEnabled(vrModeEnabled);

        device.UpdateScreenData();
    }
Esempio n. 6
0
    /// @endcond

    private void InitDevice()
    {
        if (device != null)
        {
            device.Destroy();
        }
        device = BaseVRDevice.GetDevice();
        device.Init();

        List <string> diagnostics = new List <string>();

        NativeDistortionCorrectionSupported = device.SupportsNativeDistortionCorrection(diagnostics);
        if (diagnostics.Count > 0)
        {
            Debug.LogWarning("Built-in distortion correction disabled. Causes: ["
                             + String.Join("; ", diagnostics.ToArray()) + "]");
        }
        diagnostics.Clear();
        NativeUILayerSupported = device.SupportsNativeUILayer(diagnostics);
        if (diagnostics.Count > 0)
        {
            Debug.LogWarning("Built-in UI layer disabled. Causes: ["
                             + String.Join("; ", diagnostics.ToArray()) + "]");
        }

        if (DefaultDeviceProfile != null)
        {
            device.SetDefaultDeviceProfile(DefaultDeviceProfile);
        }

        device.SetDistortionCorrectionEnabled(distortionCorrection == DistortionCorrectionMethod.None &&         //Fix
                                              NativeDistortionCorrectionSupported);
//		device.SetDistortionCorrectionEnabled (false);     //Fix
        device.SetNeckModelScale(neckModelScale);

#if !UNITY_HAS_GOOGLEVR || UNITY_EDITOR
        device.SetVRModeEnabled(vrModeEnabled);
#endif  // !UNITY_HAS_GOOGLEVR || UNITY_EDITOR

        device.UpdateScreenData();
    }
Esempio n. 7
0
    /// @endcond

    private void InitDevice()
    {
        if (device != null)
        {
            device.Destroy();
        }
        device = BaseVRDevice.GetDevice();
        device.Init();

        List <string> diagnostics = new List <string>();

        NativeDistortionCorrectionSupported = device.SupportsNativeDistortionCorrection(diagnostics);
        if (diagnostics.Count > 0)
        {
            Debug.LogWarning("Built-in distortion correction disabled. Causes: ["
                             + String.Join("; ", diagnostics.ToArray()) + "]");
        }
        diagnostics.Clear();
        NativeUILayerSupported = device.SupportsNativeUILayer(diagnostics);
        if (diagnostics.Count > 0)
        {
            Debug.LogWarning("Built-in UI layer disabled. Causes: ["
                             + String.Join("; ", diagnostics.ToArray()) + "]");
        }

        if (DefaultDeviceProfile != null)
        {
            device.SetDefaultDeviceProfile(DefaultDeviceProfile);
        }

        device.SetDistortionCorrectionEnabled(distortionCorrection == DistortionCorrectionMethod.Native &&
                                              NativeDistortionCorrectionSupported);
        device.SetNeckModelScale(neckModelScale);
        device.SetElectronicDisplayStabilizationEnabled(electronicDisplayStabilization);

        device.SetVRModeEnabled(vrModeEnabled);

        device.UpdateScreenData();
    }
Esempio n. 8
0
    private void InitDevice()
    {
        if (device != null)
        {
            device.Destroy();
        }
        device = BaseVRDevice.GetDevice();
        device.Init();

        List <string> diagnostics = new List <string>();

        NativeDistortionCorrectionSupported = device.SupportsNativeDistortionCorrection(diagnostics);
        if (diagnostics.Count > 0)
        {
            Debug.LogWarning("Built-in distortion correction disabled. Causes: ["
                             + String.Join("; ", diagnostics.ToArray()) + "]");
        }
        diagnostics.Clear();
        NativeUILayerSupported = device.SupportsNativeUILayer(diagnostics);
        if (diagnostics.Count > 0)
        {
            Debug.LogWarning("Built-in UI layer disabled. Causes: ["
                             + String.Join("; ", diagnostics.ToArray()) + "]");
        }

        device.SetVRModeEnabled(vrModeEnabled);
        device.SetDistortionCorrectionEnabled(distortionCorrection &&
                                              NativeDistortionCorrectionSupported);
        device.SetAlignmentMarkerEnabled(enableAlignmentMarker &&
                                         NativeUILayerSupported);
        device.SetSettingsButtonEnabled(enableSettingsButton &&
                                        NativeUILayerSupported);
        device.SetNeckModelScale(neckModelScale);
        device.SetAutoDriftCorrectionEnabled(autoDriftCorrection);

        device.UpdateScreenData();
    }