using UnityEngine; using UnityEngine.EventSystems; using System; using vnxbqy.UI; public class NPCInteractProcessor : MonoBehaviour, IPointerClickHandler { public static event Action s_NpcInteractEvent; public event Action npcIntergactEvent; E_NpcType m_NPCType = E_NpcType.Func; public E_NpcType npcType { get { return m_NPCType; } set { m_NPCType = value; } } int m_NPCId = 0; public int npcId { get { return m_NPCId; } set { m_NPCId = value; } } uint m_NPCInstanceId = 0; public uint npcInstanceId { get { return m_NPCInstanceId; } set { m_NPCInstanceId = value; } } public void OnPointerClick(PointerEventData eventData) { if (npcIntergactEvent != null) { npcIntergactEvent(); } } public static void InvokeEvent(E_NpcType _type, int npcID, uint instanceID) { if (s_NpcInteractEvent == null) { return; } s_NpcInteractEvent(_type, npcID, instanceID); } }