Procházet zdrojové kódy

Merge branch 'master' of https://github.com/BabylonJS/Babylon.js

David Catuhe před 6 roky
rodič
revize
d1cb058dbb

+ 2 - 0
inspector/src/components/sceneExplorer/entities/sceneTreeItemComponent.tsx

@@ -83,6 +83,8 @@ export class SceneTreeItemComponent extends React.Component<ISceneTreeItemCompon
                         this.forceUpdate();
                     }
                     manager.attachToMesh(this._selectedEntity.reservedDataStore.lightGizmo.attachedMesh);
+                }else{
+                    manager.attachToMesh(null);
                 }
             }
         });

+ 8 - 0
src/Gizmos/lightGizmo.ts

@@ -185,6 +185,14 @@ export class LightGizmo extends Gizmo {
         return root;
     }
 
+    /**
+     * Disposes of the light gizmo
+     */
+    public dispose() {
+        this._material.dispose();
+        super.dispose();
+    }
+
     private static _CreateHemisphericLightMesh(scene: Scene) {
         var root = new Mesh("hemisphereLight", scene);
         var hemisphere = HemisphereBuilder.CreateHemisphere(root.name, {segments: 10, diameter: 1}, scene);