private function onEvent(trackIndex:Int, event:Event):Void
{
// Update "this" SkeletonBounds with current skeleton bounding box positions (the ones created in Spine, important !)
bounds.update(skeleton, true);
// The same for the enemy skeleton
Reg.enemy.bounds.update(Reg.enemy.skeleton, true);
// Trace the event name you added into Spine (not used here because just testing on event = hit)
FlxG.log.add("Track:" + trackIndex + "=" + state.getCurrent(trackIndex) + ", Event: " + event);
// Use the built-in method to check collisions between the "meta" bounding box of the two objects
// "meta" bouding box is the bouding box surrounding all the bounding boxes
FlxG.log.add(bounds.aabbIntersectsSkeleton(Reg.enemy.bounds));
}