Explorar o código

Fixed issue where clicking WMR button would cause onExitingVR observable to fire twice.

Atulya Ravishankar %!s(int64=7) %!d(string=hai) anos
pai
achega
bbdc29e0fe
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/Cameras/VR/babylon.vrExperienceHelper.ts

+ 1 - 1
src/Cameras/VR/babylon.vrExperienceHelper.ts

@@ -777,7 +777,7 @@ module BABYLON {
                 // A VR display is connected
                 this._webVRpresenting = vrDisplay.isPresenting;
 
-                if (wasPresenting && !this._webVRpresenting)
+                if (wasPresenting && !this._webVRpresenting && this.isInVRMode)
                     this.exitVR();
             } else {
                 Tools.Warn('Detected VRDisplayPresentChange on an unknown VRDisplay. Did you can enterVR on the vrExperienceHelper?');