diff --git a/src/game-lib-entity.js b/src/game-lib-entity.js index a4219d7..ad08754 100644 --- a/src/game-lib-entity.js +++ b/src/game-lib-entity.js @@ -138,6 +138,13 @@ GameLib.D3.Entity.prototype.addComponent = function( }; +GameLib.D3.Entity.prototype.removeComponent = function(component) { + if(component && component.id && this.parentScene.idToComponent[component.id]) { + this.ids = this.ids.splice(this.ids.indexOf(component), 1); + delete this.parentScene.idToComponent[component.id]; + } +}; + GameLib.D3.Entity.prototype.getComponent = function( componentType ) {