浏览代码

Remove sound tabs from inspector

sebastien 7 年之前
父节点
当前提交
a4cc2c8343
共有 1 个文件被更改,包括 5 次插入2 次删除
  1. 5 2
      inspector/src/tabs/TabBar.ts

+ 5 - 2
inspector/src/tabs/TabBar.ts

@@ -1,4 +1,4 @@
-import { AbstractMesh, Nullable } from "babylonjs";
+import { AbstractMesh, Nullable, Engine } from "babylonjs";
 import { BasicElement } from "../gui/BasicElement";
 import { Helpers } from "../helpers/Helpers";
 import { Inspector } from "../Inspector";
@@ -60,7 +60,10 @@ export class TabBar extends BasicElement {
         }
         this._tabs.push(new PhysicsTab(this, this._inspector));
         this._tabs.push(new CameraTab(this, this._inspector));
-        this._tabs.push(new SoundTab(this, this._inspector));
+        // Only uses sounds if available.
+        if (Engine.audioEngine) {
+            this._tabs.push(new SoundTab(this, this._inspector));
+        }
         this._tabs.push(new ToolsTab(this, this._inspector));
         this._toolBar = new Toolbar(this._inspector);