addde remove component method to entity
parent
61ed31e517
commit
2895b74b6c
|
@ -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
|
||||
) {
|
||||
|
|
Loading…
Reference in New Issue