Explorar o código

Fix Disabling Lights hot swapping.

sebavan %!s(int64=5) %!d(string=hai) anos
pai
achega
e53e4b95cb
Modificáronse 1 ficheiros con 3 adicións e 2 borrados
  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 */