Esempio n. 1
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. 2
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()) + "]");
        }

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

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

        device.UpdateScreenData();
    }
  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) {
      ConsoleLog.SLogWarning("Built-in distortion correction disabled. Causes: ["
                       + String.Join("; ", diagnostics.ToArray()) + "]");
    }
    diagnostics.Clear();
    NativeUILayerSupported = device.SupportsNativeUILayer(diagnostics);
    if (diagnostics.Count > 0) {
      ConsoleLog.SLogWarning("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();
  }