框架上传
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
|
||||
namespace Stary.Evo
|
||||
{
|
||||
public class OnPointerExitEventTrigger : MonoBehaviour, IPointerExitHandler
|
||||
{
|
||||
public readonly EasyEvent<PointerEventData> OnPointerExitEvent = new EasyEvent<PointerEventData>();
|
||||
|
||||
public void OnPointerExit(PointerEventData eventData)
|
||||
{
|
||||
OnPointerExitEvent.Trigger(eventData);
|
||||
}
|
||||
}
|
||||
|
||||
public static class OnPointerExitEventTriggerExtension
|
||||
{
|
||||
public static IUnRegister OnPointerExitEvent<T>(this T self, Action<PointerEventData> onPointerExit)
|
||||
where T : Component
|
||||
{
|
||||
return self.GetOrAddComponent<OnPointerExitEventTrigger>().OnPointerExitEvent.Register(onPointerExit);
|
||||
}
|
||||
|
||||
public static IUnRegister OnPointerExitEvent(this GameObject self, Action<PointerEventData> onPointerExit)
|
||||
{
|
||||
return self.GetOrAddComponent<OnPointerExitEventTrigger>().OnPointerExitEvent.Register(onPointerExit);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user