using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using GOEventSystem; public class Cam_InteractionObject : MonoBehaviour,IPointerClickHandler,IPointerHoverHandler,IPointerDoubleClickHandler { //无参事件 public event GOButtonAction Event_HoverEnter; public event GOButtonAction Event_HoverExit; public event GOButtonAction Event_Click; public event GOButtonAction Event_DoubleClick; //传参事件 public event GOButtonParamAction Event_ParamHoverEnter; public event GOButtonParamAction Event_ParamHoverExit; public event GOButtonParamAction Event_ParamClick; public event GOButtonParamAction Event_ParamDoubleClick; public void OnHoverEnter(GOPointerEventData eventData) { Event_HoverEnter?.Invoke(); Event_ParamHoverEnter?.Invoke(eventData); } public void OnHoverExit(GOPointerEventData eventData) { Event_HoverExit?.Invoke(); Event_ParamHoverExit?.Invoke(eventData); } public void OnPointerClick(GOPointerEventData eventData) { Event_Click?.Invoke(); eventData.pointerPress = this.gameObject; Event_ParamClick?.Invoke(eventData); } public void OnPointerDoubleClick(GOPointerEventData eventData) { Event_DoubleClick?.Invoke(); Event_ParamDoubleClick?.Invoke(eventData); } }