浏览代码

Inspector - Fix bug on sandbox where the bottom div dissapear when closing the inspector

Temechon 8 年之前
父节点
当前提交
9982bd6008
共有 2 个文件被更改,包括 9 次插入6 次删除
  1. 3 2
      inspector/src/Inspector.ts
  2. 6 4
      inspector/test/index.js

+ 3 - 2
inspector/src/Inspector.ts

@@ -240,13 +240,14 @@ module INSPECTOR {
             if (!this._popupMode) {
                 // Get canvas
                 let canvas         = this._scene.getEngine().getRenderingCanvas(); 
+
                 // restore canvas style
                 for (let prop in this._canvasStyle) {
                     canvas.style[prop] = this._canvasStyle[prop];
                 }
-                // Get parent of the wrapper           
+                // Get parent of the wrapper 
                 let canvasParent   = canvas.parentElement.parentElement;  
-                canvasParent.appendChild(canvas);                              
+                canvasParent.insertBefore(canvas, this._c2diwrapper);
                 // Remove wrapper
                 Helpers.CleanDiv(this._c2diwrapper);
                 this._c2diwrapper.remove();                   

+ 6 - 4
inspector/test/index.js

@@ -16,10 +16,7 @@ var Test = (function () {
     Test.prototype._run = function () {
         var _this = this;
         this._initScene();
-        // BABYLON.DebugLayer.InspectorURL = 'http://localhost:1338/dist/preview release/inspector/babylon.inspector.js';
-        window.addEventListener('click', () => {
-            this.scene.debugLayer.show();
-        })
+        this.scene.debugLayer.show();
         this.scene.executeWhenReady(function () {
             _this._initGame();
             _this.engine.runRenderLoop(function () {
@@ -92,6 +89,11 @@ var Test = (function () {
     };
     Test.prototype._initGame = function () {
         this._createCanvas();
+        BABYLON.SceneLoader.ImportMesh('', 'test/', 'Rabbit.babylon', this.scene, (meshes) => {
+            meshes.forEach((mesh) => {
+                console.log(mesh.name);
+            })
+        });
     };
     /**
      * Create the canvas2D