📅  最后修改于: 2022-03-11 14:48:51.399000             🧑  作者: Mango
public LayerMask layerMask;
private void OnTriggerEnter(Collider other)
{
if (((1 << other.gameObject.layer) & layerMask) != 0)
{
// Do stuff
}
}