瀏覽代碼

make parameter not specific to linesMesh color Shader

Julien Barrois 6 年之前
父節點
當前提交
8af8ad793c
共有 2 個文件被更改,包括 6 次插入6 次删除
  1. 3 3
      src/Materials/babylon.material.ts
  2. 3 3
      src/Materials/babylon.shaderMaterial.ts

+ 3 - 3
src/Materials/babylon.material.ts

@@ -1271,9 +1271,9 @@ module BABYLON {
          * Disposes the material
          * @param forceDisposeEffect specifies if effects should be forcefully disposed
          * @param forceDisposeTextures specifies if textures should be forcefully disposed
-         * @param isLineMeshColorShader specifies if the material that is being disposed is the ShaderMaterial of a LinesMesh
+         * @param notBoundToMesh specifies if the material that is being disposed is known to be not bound to any mesh
          */
-        public dispose(forceDisposeEffect?: boolean, forceDisposeTextures?: boolean, isLineMeshColorShader?: boolean): void {
+        public dispose(forceDisposeEffect?: boolean, forceDisposeTextures?: boolean, notBoundToMesh?: boolean): void {
             const scene = this.getScene();
             // Animations
             scene.stopAnimation(this);
@@ -1282,7 +1282,7 @@ module BABYLON {
             // Remove from scene
             scene.removeMaterial(this);
 
-            if (isLineMeshColorShader !== true) {
+            if (notBoundToMesh !== true) {
                 // Remove from meshes
                 if (this.meshMap) {
                     for (let meshId in this.meshMap) {

+ 3 - 3
src/Materials/babylon.shaderMaterial.ts

@@ -656,9 +656,9 @@ module BABYLON {
          * Disposes the material
          * @param forceDisposeEffect specifies if effects should be forcefully disposed
          * @param forceDisposeTextures specifies if textures should be forcefully disposed
-         * @param isLineMeshColorShader specifies if the material that is being disposed is the ShaderMaterial of a LinesMesh
+         * @param notBoundToMesh specifies if the material that is being disposed is known to be not bound to any mesh
          */
-        public dispose(forceDisposeEffect?: boolean, forceDisposeTextures?: boolean, isLineMeshColorShader?: boolean): void {
+        public dispose(forceDisposeEffect?: boolean, forceDisposeTextures?: boolean, notBoundToMesh?: boolean): void {
 
             if (forceDisposeTextures) {
                 var name: string;
@@ -676,7 +676,7 @@ module BABYLON {
 
             this._textures = {};
 
-            super.dispose(forceDisposeEffect, forceDisposeTextures, isLineMeshColorShader);
+            super.dispose(forceDisposeEffect, forceDisposeTextures, notBoundToMesh);
         }
 
         /**