by robaldred » Fri Feb 07, 2014 4:26 pm
removeComponent already has this functionality.
Simply define a `destroy` method in your component.
EG.
- Code: Select all
var MyVelocityComponent = IgeEventingClass.extend({
classId: 'MyVelocityComponent',
componentId: 'velocity',
init: function (entity, options) {
//...
},
destroy: function () {
//do something before we're gone
}
});
I don't work for Irrelon. All comments are my own.
I would strongly encourage anyone building production projects with Isogenic to
buy a premium licence, it costs very little and will help towards continued development of the engine. Irrelon have spent thousands of hours developing this wonderful platform with many features found in AAA game engine.