包含此页的版本:
不含此页的版本:
此游戏对象是否使用 tag 进行了标记?
tag
using UnityEngine; using System.Collections;public class ExampleClass : MonoBehaviour { void OnTriggerEnter(Collider other) { if (other.CompareTag("Player")) Destroy(other.gameObject); } }