feat: 扩展 Framework 核心事件系统功能
Made-with: Cursor
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using System.Linq;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
using UnityEngine.EventSystems;
|
||||
@@ -109,8 +109,11 @@ namespace AibisDream.Framework
|
||||
|
||||
public override void OnDrag(PointerEventData eventData)
|
||||
{
|
||||
EventSystemEx.Instance.OnDrag(_interaction);
|
||||
base.OnDrag(eventData);
|
||||
if (_interaction.IsAvailable && !EventSystemEx.Instance.isLocked)
|
||||
{
|
||||
EventSystemEx.Instance.OnDrag(_interaction);
|
||||
base.OnDrag(eventData);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnEndDrag(PointerEventData eventData)
|
||||
@@ -121,8 +124,11 @@ namespace AibisDream.Framework
|
||||
|
||||
public override void OnBeginDrag(PointerEventData eventData)
|
||||
{
|
||||
EventSystemEx.Instance.OnEndDrag(_interaction);
|
||||
base.OnBeginDrag(eventData);
|
||||
if (_interaction.IsAvailable && !EventSystemEx.Instance.isLocked)
|
||||
{
|
||||
EventSystemEx.Instance.OnEndDrag(_interaction);
|
||||
base.OnBeginDrag(eventData);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnPointerClick(PointerEventData eventData)
|
||||
@@ -130,6 +136,11 @@ namespace AibisDream.Framework
|
||||
// EventSystemEx.Instance.OnPointerClick(_interaction);
|
||||
base.OnPointerClick(eventData);
|
||||
}
|
||||
|
||||
void OnDestroy()
|
||||
{
|
||||
EventSystemEx.Instance.UnRegister(_interaction);
|
||||
}
|
||||
}
|
||||
|
||||
public interface IInteraction
|
||||
|
||||
Reference in New Issue
Block a user