框架上传

This commit is contained in:
2025-03-31 11:16:52 +08:00
parent 7197b4c0d0
commit ffcdddbd2a
429 changed files with 19115 additions and 1579 deletions

View File

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