瀏覽代碼

Small bug fix

Raanan Weber 9 年之前
父節點
當前提交
5ea60a9079
共有 1 個文件被更改,包括 5 次插入2 次删除
  1. 5 2
      src/Cameras/VR/babylon.webVRCamera.ts

+ 5 - 2
src/Cameras/VR/babylon.webVRCamera.ts

@@ -67,7 +67,7 @@ module BABYLON {
                     if (this.webVROptions.displayName) {
                         devices.some(device => {
                             if (device.displayName === this.webVROptions.displayName) {
-                                this.getEngine().enableVR(device);
+                                this._vrDevice = device;
                                 return true;
                             } else {
                                 return false;
@@ -75,8 +75,11 @@ module BABYLON {
                         })
                     } else {
                         //choose the first one
-                        this.getEngine().enableVR(devices[0]);
+                        this._vrDevice = devices[0];
                     }
+                    this.getEngine().enableVR(this._vrDevice)
+                } else {
+                    Tools.Error("No WebVR devices found!");
                 }
             })
         }