babylon.debugLayer.ts 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. module BABYLON {
  2. // declare INSPECTOR namespace for compilation issue
  3. declare var INSPECTOR : any;
  4. export class DebugLayer {
  5. private _scene: Scene;
  6. public static InspectorURL = 'http://www.babylonjs.com/inspector.js'
  7. constructor(scene: Scene) {
  8. this._scene = scene;
  9. }
  10. /** Creates the inspector window. */
  11. private _createInspector() {
  12. new INSPECTOR.Inspector(this._scene);
  13. }
  14. public isVisible(): boolean {
  15. return true;
  16. }
  17. public hide() {
  18. console.warn('')
  19. }
  20. public show() {
  21. if (typeof INSPECTOR == 'undefined') {
  22. // Load inspector and add it to the DOM
  23. Tools.LoadScript(DebugLayer.InspectorURL, this._createInspector.bind(this));
  24. } else {
  25. // Otherwise creates the inspector
  26. this._createInspector();
  27. }
  28. }
  29. }
  30. }