📅  最后修改于: 2022-03-11 14:49:17.749000             🧑  作者: Mango
public class Player : MonoBehaviour
{
//Set this game object by dragging on UI
public GameObject body;
private void OnCollisionEnter2D(Collision2D other) {
if(body != null){
body.GetComponent().enabled = false;
Destroy(body);
}
}
}