Files
ft/Client/Assets/Scripts/EventPartnerGather/Mining/RegionTrigger.cs
2026-06-29 21:18:33 +08:00

27 lines
716 B
C#

using asap.core;
using UnityEngine;
namespace UI.PartnerGather.Mining
{
public class RegionTrigger : MonoBehaviour
{
public string playerTag = "Player"; // 识别进入者
private void ELog(object t)
{
#if UNITY_EDITOR
Debug.Log($"<Color=cyan> RegionTrigger {t} </color>");
#endif
}
private void OnTriggerEnter(Collider other)
{
if (!other.CompareTag(playerTag)) return;
GContext.Publish(new EnterTrophyEvent());
}
private void OnTriggerExit(Collider other)
{
ELog($"OnTriggerExit tag={other.tag}");
if (!other.CompareTag(playerTag)) return;
}
}
}