There's a few ways you could go about this:
- One option would be to make your enemies no longer overlap. You could turn them into
RigidBody2Ds and then configure their collision masks and layers to no longer allow overlapping. If you actually intentionally want enemies to be able to overlap, this is not the way to go. This also wouldn't necessarily stop the sword from hitting multiple enemies in one swing; just make it less likely.
- Use a boolean variable to track if the sword has hit anything during its current swing. Every time a collision is detected, check to make sure this is the first thing you've hit before processing the consequences. Reset the variable after the swing finishes. This probably means using the sword's collision signals instead of the enemies' collision signals.
There's probably other ways to do this as well, these are just two options that came to mind.