Преглед изворни кода

Merge pull request #7934 from sebavan/master

Fix Disabling Lights hot swapping.
sebavan пре 5 година
родитељ
комит
ba389b06cb
1 измењених фајлова са 3 додато и 2 уклоњено
  1. 3 2
      src/Meshes/abstractMesh.ts

+ 3 - 2
src/Meshes/abstractMesh.ts

@@ -785,7 +785,7 @@ export class AbstractMesh extends TransformNode implements IDisposable, ICullabl
         var isIn = light.isEnabled() && light.canAffectMesh(this);
         var isIn = light.isEnabled() && light.canAffectMesh(this);
 
 
         var index = this._lightSources.indexOf(light);
         var index = this._lightSources.indexOf(light);
-
+        var removed = false;
         if (index === -1) {
         if (index === -1) {
             if (!isIn) {
             if (!isIn) {
                 return;
                 return;
@@ -795,10 +795,11 @@ export class AbstractMesh extends TransformNode implements IDisposable, ICullabl
             if (isIn) {
             if (isIn) {
                 return;
                 return;
             }
             }
+            removed = true;
             this._lightSources.splice(index, 1);
             this._lightSources.splice(index, 1);
         }
         }
 
 
-        this._markSubMeshesAsLightDirty();
+        this._markSubMeshesAsLightDirty(removed);
     }
     }
 
 
     /** @hidden */
     /** @hidden */