27 lines
716 B
C#
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;
|
|
}
|
|
}
|
|
} |