fuseCollision<C extends PositionComponent> function
Calls fn
when this component is colliding with another component of type C
.
Implementation
void fuseCollision<C extends PositionComponent>(FuseCollisionFn<C> fn) {
_fuseCollisionsCheck();
final component = fuseComponent<FuseCollisions>();
component._collisionFns.add((target) {
if (target is C) {
fn(target);
}
});
}