using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Events; using UnityEngine.EventSystems; public class NewUserGuiderButton : MonoBehaviour, IPointerUpHandler { public Action onClick; public void OnPointerUp(PointerEventData eventData) { RectTransform target = GetComponent().GetTarget(); bool hit = RectTransformUtility.RectangleContainsScreenPoint(target, eventData.position); if (hit) { onClick.Invoke(); } } }