Kaynağa Gözat

Merge pull request #4873 from atulyar/vr-button-exit-observable-fix

Vr button exit observable fix
David Catuhe 7 yıl önce
ebeveyn
işleme
75e1ee54ef

+ 1 - 0
dist/preview release/what's new.md

@@ -146,6 +146,7 @@
 - Initializing gamepadManager should register the gamepad update events ([TrevorDev](https://github.com/TrevorDev))
 - Do not generate mipmaps for RawCubeTexture if OES_texture_float_linear and/or EXT_color_buffer_float extensions are not supported ([PeapBoy](https://github.com/NicolasBuecher))
 - Do not modify passed camera array parameter when creating a default pipeline ([TrevorDev](https://github.com/TrevorDev))
+- Fixed issue where VRExperienceHelper.onExitingVR observable was being fired twice ([atulyar](https://github.com/atulyar))
 
 ### Core Engine
 

+ 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?');