using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.EventSystems; public class ClickableCollider : MonoBehaviour { public event Action OnClick; public void Click(PointerEventData eventData) => OnClick?.Invoke(this, eventData); void Start() { var proto = GetComponent(); if(proto != null) proto.OnReturnToPool += () => OnClick = null; } }