Unity - OnTriggerEnter2D OnCollisionEnter2D

触发条件:

OnTriggerEnter2D :

1.层级设置可以发生碰撞

2.至少一方具备Rigidbody2D, 且不为Static

3.双方都有Collider2D

4.至少一方IsTrigger = true

OnCollisionEnter2D:

1.层级设置可以发生碰撞

2.至少一方具备Rigidbody2D, 且不为Static

3.双方都有Collider2D

4.双方均为 IsTrigger = false

你可能感兴趣的:(Unity,unity,TriggerEnter2D)