Просмотр исходного кода

Update vrExperienceHelper.ts

Use the flag _hasEnteredVR instead of inVRMode to avoid wrong conditions when controller is connected.
CLosing https://github.com/BabylonJS/Babylon.js/issues/6967
Raanan Weber 5 лет назад
Родитель
Сommit
7a1a3691ae
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      src/Cameras/VR/vrExperienceHelper.ts

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

@@ -831,7 +831,7 @@ export class VRExperienceHelper {
 
 
         // Exiting VR mode double tapping the touch screen
         // Exiting VR mode double tapping the touch screen
         this._scene.onPrePointerObservable.add(() => {
         this._scene.onPrePointerObservable.add(() => {
-            if (this.isInVRMode && this.exitVROnDoubleTap) {
+            if (this._hasEnteredVR && this.exitVROnDoubleTap) {
                 this.exitVR();
                 this.exitVR();
                 if (this._fullscreenVRpresenting) {
                 if (this._fullscreenVRpresenting) {
                     this._scene.getEngine().exitFullscreen();
                     this._scene.getEngine().exitFullscreen();