Skip to content

Commit

Permalink
Merge pull request #373 from playcanvas/remove-debug-shapes
Browse files Browse the repository at this point in the history
Remove debug shapes
  • Loading branch information
Maksims committed Jul 30, 2015
2 parents 731abaa + 56b1dd9 commit 673574d
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/framework/components/light/light_system.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,21 @@ pc.extend(pc, function () {
},

changeType: function (component, oldValue, newValue) {
component.light.setType(lightTypes[newValue]);
// remove old light
this.app.scene.removeLight(component.light);
// create new light
var light = new pc.Light();
light.setType(lightTypes[newValue]);
light._node = component.entity;
// add to scene
this.app.scene.addLight(light);
// add to component
component.light = light;
component.data.light = light;
}
});

return {
LightComponentSystem: LightComponentSystem
};
}());


0 comments on commit 673574d

Please sign in to comment.