📜  unity 忽略两个对象之间的碰撞 - C# 代码示例

📅  最后修改于: 2022-03-11 14:49:03.793000             🧑  作者: Mango

代码示例1
private void OnCollisionEnter(Collision collision)
{
    if (collision.gameObject.layer == layerToIgnore)
        Physics.IgnoreCollision(collision.gameObject.GetComponent(), GetComponent());
}