How to run a collision between 2 objects only once

So currently we have a unit prefab which is to take the field in a simple RTS game. The unit is the same spawned for both players as well as all AI teams.

Currently we are using a health based system for the units with a bit of randomness thrown in, which leads me to my question, how can we make it so that only one of the colliders is called? both are the same prefab, both contain the same set of scripts, when unit A encounters B it will run its script and then B will run its, how can we make it so that only one script is run for the entire collision?

I feel like there’s a “good” way to do it, but this should work:

All objects are numbered. Maybe a single list, or they have team#'s, then unit#'s within the team. On a collision with a similar unit, only run your code if you are a higher number. Ex:

void OnCollisionEnter(Collision C) {
  if(C!= null &&>team || && C.playerNum>playerNum) return;

FYI think this is a standard operating systems trick.