【add】staryEvoTools

This commit is contained in:
2025-09-02 10:54:13 +08:00
parent e3050cd137
commit 796c8d845d
173 changed files with 7783 additions and 0 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);
}
}
}