Forráskód Böngészése

feat: OnMaterialRemovedObservable notifies its observers

yuccai 7 éve
szülő
commit
17c638d81d
2 módosított fájl, 4 hozzáadás és 1 törlés
  1. 2 1
      src/Materials/babylon.material.ts
  2. 2 0
      src/babylon.scene.ts

+ 2 - 1
src/Materials/babylon.material.ts

@@ -1,4 +1,4 @@
-module BABYLON {
+module BABYLON {
     /**
      * Manages the defines for the Material
      */
@@ -1270,6 +1270,7 @@ module BABYLON {
             if (index >= 0) {
                 this._scene.materials.splice(index, 1);
             }
+            this._scene.onMaterialRemovedObservable.notifyObservers(this);
 
             // Remove from meshes
             for (index = 0; index < this._scene.meshes.length; index++) {

+ 2 - 0
src/babylon.scene.ts

@@ -3118,6 +3118,8 @@ module BABYLON {
             if (index !== -1) {
                 this.materials.splice(index, 1);
             }
+            this.onMaterialRemovedObservable.notifyObservers(toRemove);
+            
             return index;
         }