瀏覽代碼

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

Atulya Ravishankar 7 年之前
父節點
當前提交
bbdc29e0fe
共有 1 個文件被更改,包括 1 次插入1 次删除
  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?');