public void SetDistortionRendering(DistortionRenderingMode mode)
 {
     if (this.mDistortionRenderingMode != mode)
     {
         this.mDistortionRenderingMode = mode;
         if (Application.isPlaying)
         {
             if (mode == DistortionRenderingMode.None)
             {
                 this.DisableDistortionRendering();
             }
             else
             {
                 this.EnableDistortionRendering();
             }
             if (this.CameraConfiguration != null)
             {
                 this.CameraConfiguration.SetCameraParameterChanged();
                 StereoViewerCameraConfiguration stereoViewerCameraConfiguration = this.CameraConfiguration as StereoViewerCameraConfiguration;
                 if (stereoViewerCameraConfiguration != null)
                 {
                     stereoViewerCameraConfiguration.SetDistortion(this.mDistortionRenderingMode > DistortionRenderingMode.None);
                 }
             }
         }
     }
 }
 protected override void Awake()
 {
     VuforiaAbstractConfiguration.DigitalEyewearConfiguration digitalEyewear = VuforiaAbstractConfiguration.Instance.DigitalEyewear;
     this.mCameraOffset             = digitalEyewear.CameraOffset;
     this.mDistortionRenderingMode  = digitalEyewear.DistortionRenderingMode;
     this.mDistortionRenderingLayer = digitalEyewear.DistortionRenderingLayer;
     this.mEyewearType             = digitalEyewear.EyewearType;
     this.mStereoFramework         = digitalEyewear.StereoFramework;
     this.mSeeThroughConfiguration = digitalEyewear.SeeThroughConfiguration;
     this.mViewerName         = digitalEyewear.ViewerName;
     this.mViewerManufacturer = digitalEyewear.ViewerManufacturer;
     this.mUseCustomViewer    = digitalEyewear.UseCustomViewer;
     this.mCustomViewer       = digitalEyewear.CustomViewer;
     if (this.mEyewearType == DigitalEyewearARController.EyewearType.VideoSeeThrough && this.mStereoFramework != DigitalEyewearARController.StereoFramework.Vuforia)
     {
         this.mCentralAnchorPoint = base.VuforiaBehaviour.CentralAnchorPoint;
         this.mParentAnchorPoint  = base.VuforiaBehaviour.ParentAnchorPoint;
         this.mPrimaryCamera      = base.VuforiaBehaviour.PrimaryCamera;
         this.mSecondaryCamera    = base.VuforiaBehaviour.SecondaryCamera;
     }
     if (this.mEyewearType == DigitalEyewearARController.EyewearType.OpticalSeeThrough && this.mSeeThroughConfiguration == DigitalEyewearARController.SeeThroughConfiguration.HoloLens)
     {
         this.mCentralAnchorPoint = base.VuforiaBehaviour.CentralAnchorPoint;
     }
     this.mVuforiaBehaviour = VuforiaARController.Instance;
     this.mVuforiaBehaviour.RegisterVuforiaInitializedCallback(new Action(this.OnVuforiaInitialized));
     this.mVuforiaBehaviour.RegisterVuforiaStartedCallback(new Action(this.OnVuforiaStarted));
     if (VuforiaRuntimeUtilities.IsPlayMode() && this.mEyewearType == DigitalEyewearARController.EyewearType.OpticalSeeThrough)
     {
         Device.SetPlayModeEyewearDevice();
         return;
     }
     Device.UnsetDevice();
 }