对于玩家Player设置
第一种设置:
第二种设置
被触发的物体的设置
测试脚本内容如下:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class TrrigerTest : MonoBehaviour {
private void OnTriggerEnter(Collider other)
{
Debug.LogError("进入");
}
private void OnTriggerExit(Collider other)
{
Debug.LogError("出去");
}
}