📜  碰撞时统一销毁对象 - C# 代码示例

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

代码示例1
void OnCollisionEnter2D(Collision2D coll)
}
   // Check if we have collided with the enemy
   if (coll.gameObject.tag == "Enemy")
   {
      Destroy(coll.gameObject);     
   }
}