protected override void OnApplicationPause(bool pause)
 {
     if (!VuforiaRuntimeUtilities.IsPlayMode())
     {
         if (pause)
         {
             if (!this.mPaused)
             {
                 if (this.mOnPause != null)
                 {
                     this.mOnPause.InvokeWithExceptionHandling(true);
                 }
                 ObjectTracker tracker = TrackerManager.Instance.GetTracker <ObjectTracker>();
                 this.mObjectTrackerWasActiveBeforePause = (tracker != null && tracker.IsActive);
                 this.mWasEnabledBeforePause             = base.VuforiaBehaviour.enabled;
                 if (this.mWasEnabledBeforePause)
                 {
                     this.StopVuforia();
                 }
                 GL.Clear(false, true, new Color(0f, 0f, 0f, 1f));
                 UnityPlayer.Instance.OnPause();
             }
         }
         else if (this.mPaused)
         {
             UnityPlayer.Instance.OnResume();
             if (this.mWasEnabledBeforePause && this.StartVuforia(this.mObjectTrackerWasActiveBeforePause))
             {
                 IOSCamRecoveringHelper.SetHasJustResumed();
             }
             this.ResetBackgroundPlane(true);
             if (this.mOnPause != null)
             {
                 this.mOnPause.InvokeWithExceptionHandling(false);
             }
         }
     }
     this.mPaused = pause;
 }
 private void UpdateStatePrivate(bool forceUpdate, bool reapplyOldState)
 {
     if (this.mCheckStopCamera)
     {
         this.DisableCameraIfNotNeeded();
         this.mCheckStopCamera = false;
     }
     if (VuforiaManager.Instance.Initialized && this.mCameraConfiguration != null)
     {
         this.ApplyMissedProjectionMatrices();
     }
     if (forceUpdate || Time.frameCount > this.mLastUpdatedFrame)
     {
         this.DeinitRequestedTrackers();
         if (VuforiaManager.Instance.Initialized)
         {
             UnityPlayer.Instance.Update();
             ScreenOrientation counterRotation;
             this.mCameraConfiguration.CheckForSurfaceChanges(out counterRotation);
             if (!this.mMetalRendering)
             {
                 this.mClearMaterial.SetPass(0);
             }
             if (((VuforiaManagerImpl)VuforiaManager.Instance).Update(counterRotation, reapplyOldState))
             {
                 IOSCamRecoveringHelper.SetSuccessfullyRecovered();
                 this.ResetBackgroundPlane(false);
                 using (List <ITrackerEventHandler> .Enumerator enumerator = this.mTrackerEventHandlers.GetEnumerator())
                 {
                     while (enumerator.MoveNext())
                     {
                         enumerator.Current.OnTrackablesUpdated();
                     }
                 }
                 this.mCameraConfiguration.UpdateStereoDepth(VuforiaManager.Instance.CentralAnchorPoint);
                 if (this.mOnTrackablesUpdated != null)
                 {
                     this.mOnTrackablesUpdated.InvokeWithExceptionHandling();
                 }
             }
             else
             {
                 IOSCamRecoveringHelper.TryToRecover();
             }
             if (this.mRenderOnUpdate != null)
             {
                 this.mRenderOnUpdate.InvokeWithExceptionHandling();
             }
         }
         else if (VuforiaRuntimeUtilities.IsPlayMode() && !this.mStartHasBeenInvoked)
         {
             Debug.LogWarning("Scripts have been recompiled during Play mode, need to restart!");
             VuforiaWrapper.CreateRuntimeInstance();
             PlayModeEditorUtility.Instance.RestartPlayMode();
         }
         if (VuforiaRenderer.InternalInstance.HasBackgroundTextureChanged())
         {
             this.mBackgroundTextureHasChanged = true;
             if (this.mOnBackgroundTextureChanged != null)
             {
                 this.mOnBackgroundTextureChanged.InvokeWithExceptionHandling();
             }
         }
         this.mEyewearBehaviour.SetFocusPoint();
         this.mLastUpdatedFrame = Time.frameCount;
     }
 }