using System; using System.Collections; using System.Collections.Generic; using UnityEngine; namespace DTYJ { public class ChuZhanTrigger : MonoBehaviour { public Action onTriggerEnter; private void OnCollisionEnter(Collision collision) { if (collision.gameObject.layer == LayerMask.NameToLayer("ChengKeDestroy")) onTriggerEnter?.Invoke(gameObject); } //private void OnTriggerEnter(Collider other) //{ //} } }