Skip to content

Commit 114b1df

Browse files
authored
[Fix] When light component is removed, light is removed from layers (playcanvas#2593)
1 parent 92c00c1 commit 114b1df

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/framework/components/light/component.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,12 +465,16 @@ Object.assign(LightComponent.prototype, {
465465
},
466466

467467
onRemove: function () {
468+
469+
// remove from layers
470+
this.onDisable();
471+
468472
// destroy light node
469473
this.light.destroy();
474+
470475
// remove cookie asset events
471476
this.cookieAsset = null;
472477
}
473-
474478
});
475479

476480
var _lightProps = _props;

0 commit comments

Comments
 (0)