onUnuse(action: (obj: GameObj , id: string )=>void ): KEventController
Register an event that runs when an object stops using a component.
paramaction- The function that runs when the event happens.
returnsThe event controller.
sincev3001.1
groupEvents
onUnuse(tag: Tag , action: (obj: GameObj , compId: string )=>void ): KEventController
Register an event that runs when an object with the provided tag stops using a component.
paramtag- The tag to match, only called for objects with a matching tag.
paramaction- The function that runs when the event happens.
// This will run when the tagged object removes a component.
onUnuse("ghost", (obj, compId) => {
debug.log(obj, component);
});
returnsThe event controller.
sincev2000.0
groupEvents