为对象添加Box Collider
组件,并绑定检测碰撞的脚本
编写C#脚本:当两个Collider相遇时都将消失
private void OnTriggerEnter(Collider other){Destroy(gameObject);Destroy(other.gameObject);}
时间:2021-11-17 02:21:03
为对象添加Box Collider
组件,并绑定检测碰撞的脚本
编写C#脚本:当两个Collider相遇时都将消失
private void OnTriggerEnter(Collider other){Destroy(gameObject);Destroy(other.gameObject);}