public bool test = false;
void OnTriggerEnter2D(Collider2D other)
{
if (test == true && (gameObject.activeSelf == false || _collider2D.enabled == false))
{
Debug.Log("Error");
}
gameObject.SetActive(false);
_collider2D.enabled = false;
test = true;
Destroy(gameObject);
}
Codes above will print Error, like so many other questions.So I had a assume,maybe unity run collider events like this:after a physic update,unity create a delegate for every collider event then execute them one by one(all in a fixedupdate).So the problem occured when A is triggerred with B,and C in the same physic update,and it sames like a unactived collider can still be triggerred.
This is just my assumption.Thx a lot If someone can confirm it ,like checking unity source code.