浏览代码

better variable inspection when loading

Raanan Weber 7 年之前
父节点
当前提交
1fb8a49a32
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      inspector/src/Inspector.ts

+ 1 - 1
inspector/src/Inspector.ts

@@ -54,7 +54,7 @@ export class Inspector {
 
         import("babylonjs-gui").then(GUI => {
             // Load GUI library if not already done
-            if (!GUI || (<Object>GUI).hasOwnProperty("default")) {
+            if (!GUI || (typeof GUI !== "undefined" && Object.keys(GUI).indexOf("default") !== -1)) {
                 Tools.LoadScript("https://preview.babylonjs.com/gui/babylon.gui.min.js", () => {
                     Inspector.GUIObject = (<any>BABYLON).GUI;
                     this.onGUILoaded.notifyObservers(Inspector.GUIObject);