26 lines
583 B
C#
26 lines
583 B
C#
|
using System.Collections;
|
|||
|
using System.Collections.Generic;
|
|||
|
using UnityEngine;
|
|||
|
using UnityEngine.UI;
|
|||
|
using UnityEngine.EventSystems;
|
|||
|
using System;
|
|||
|
using UnityEngine.Events;
|
|||
|
|
|||
|
[RequireComponent(typeof(Image))]
|
|||
|
public class ClickEventRayCast : MonoBehaviour, IPointerClickHandler
|
|||
|
{
|
|||
|
[Serializable]
|
|||
|
public class ItemClick : UnityEvent
|
|||
|
{
|
|||
|
public ItemClick() { }
|
|||
|
}
|
|||
|
[SerializeField]
|
|||
|
public ItemClick _OnItemClick;
|
|||
|
|
|||
|
public void OnPointerClick(PointerEventData eventData)
|
|||
|
{
|
|||
|
if (_OnItemClick != null)
|
|||
|
_OnItemClick.Invoke();
|
|||
|
}
|
|||
|
}
|