디자인 적용
This commit is contained in:
36
Assets/Scripts/NHN/DragEventHandler.cs
Normal file
36
Assets/Scripts/NHN/DragEventHandler.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
namespace Gpm.Ui
|
||||
{
|
||||
using UnityEngine.Events;
|
||||
using UnityEngine.EventSystems;
|
||||
|
||||
public class DragaEventHandler : UIBehaviour, IBeginDragHandler, IDragHandler, IEndDragHandler
|
||||
{
|
||||
public DragEvent onBeginDrag = new DragEvent();
|
||||
public DragEvent onDrag = new DragEvent();
|
||||
public DragEvent onEndDrag = new DragEvent();
|
||||
|
||||
public void OnBeginDrag(PointerEventData eventData)
|
||||
{
|
||||
onBeginDrag.Invoke(eventData);
|
||||
}
|
||||
|
||||
public void OnDrag(PointerEventData eventData)
|
||||
{
|
||||
onDrag.Invoke(eventData);
|
||||
}
|
||||
|
||||
public void OnEndDrag(PointerEventData eventData)
|
||||
{
|
||||
onEndDrag.Invoke(eventData);
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class DragEvent : UnityEvent<PointerEventData>
|
||||
{
|
||||
public DragEvent()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user