using System; using UnityEngine; using UnityEngine.EventSystems; namespace Stary.Evo { public class OnDropEventTrigger: MonoBehaviour, IDropHandler { public readonly EasyEvent OnDropEvent = new EasyEvent(); public void OnDrop(PointerEventData eventData) { OnDropEvent.Trigger(eventData); } } public static class OnDropEventTriggerExtension { public static IUnRegister OnDropEvent(this T self, Action onDrop) where T : Component { return self.GetOrAddComponent().OnDropEvent.Register(onDrop); } public static IUnRegister OnDropEvent(this GameObject self, Action onDrop) { return self.GetOrAddComponent().OnDropEvent.Register(onDrop); } } }