component remove callback

A place to request and discuss new engine features / functionality

component remove callback

Postby Doidel » Fri Jan 24, 2014 8:51 pm

Hi

removeComponent (http://www.isogenicengine.com/documenta ... onent.html) provides no overrideable callback in the component itself to be executed when removed from an entity. Something like "_onRemove" or whatever would be nice. A method which gets executed once the component is being removed.

Thanks for considering!
User avatar
Doidel
 
Posts: 59
Joined: Tue Jan 14, 2014 5:05 pm

Re: component remove callback

Postby 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.
User avatar
robaldred
 
Posts: 243
Joined: Wed Oct 23, 2013 8:09 pm
Location: Manchester, England

Re: component remove callback

Postby Doidel » Fri Feb 07, 2014 4:36 pm

Oh ok, perfect, thanks!
User avatar
Doidel
 
Posts: 59
Joined: Tue Jan 14, 2014 5:05 pm


Return to New Feature Discussion

Who is online

Users browsing this forum: No registered users and 1 guest
cron