Browse Source

Merge pull request #3325 from TrevorDev/customVrButton

do not modify custom buttons style, exit if button is clicked while i…
David Catuhe 7 năm trước cách đây
mục cha
commit
58ef9d6ad8
1 tập tin đã thay đổi với 6 bổ sung2 xóa
  1. 6 2
      src/Cameras/VR/babylon.vrExperienceHelper.ts

+ 6 - 2
src/Cameras/VR/babylon.vrExperienceHelper.ts

@@ -228,7 +228,11 @@ module BABYLON {
                 }
                 if (this._btnVR) {
                     this._btnVR.addEventListener("click", () => {
-                        this.enterVR();
+                        if(!this.isInVRMode){
+                            this.enterVR();
+                        }else{
+                            this.exitVR();
+                        }
                     });
                 }
 
@@ -392,7 +396,7 @@ module BABYLON {
         }
 
         private updateButtonVisibility() {
-            if (!this._btnVR) {
+            if (!this._btnVR || this._useCustomVRButton) {
                 return;
             }
             this._btnVR.className = "babylonVRicon";