瀏覽代碼

Merge pull request #3325 from TrevorDev/customVrButton

do not modify custom buttons style, exit if button is clicked while i…
David Catuhe 7 年之前
父節點
當前提交
58ef9d6ad8
共有 1 個文件被更改,包括 6 次插入2 次删除
  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";