I suppose that ClickActionis your script. It might look something like this:
using UnityEngine.EventSystems;
public class ClickAction : MonoBehaviour, IPointerClickHandler
{
public void OnPointerClick(PointerEventData eventData)
{
}
}
The namespace UnityEngine.EventSystemsprovides you with an interface IPointerClickHandler. When your image is clicked, the code inside OnPointerClickwill be launched.
source
share