In the Inspector, I have two “Box Collider 2D”, each has a script to process different function. But how to distinguish two “Box Collider 2D” in the script?
Below is the sample:
void OnTriggerEnter2D(Collider2D other) -------------how to distinguish “other”?
{
…
}
Now I’ve learned using like this:
“Collider2D[ ] cols = GetComponents();”
But I want to use the first one, “cols[0]” is wrong. Could anybody tell me how to use the first one?