mirror of
https://github.com/RHeavenStudioPlus/HeavenStudioPlus.git
synced 2024-11-14 21:55:09 +00:00
29 lines
972 B
C#
29 lines
972 B
C#
|
using UnityEngine.EventSystems;
|
||
|
using UnityEngine.UI;
|
||
|
|
||
|
namespace HeavenStudio.Editor.Track
|
||
|
{
|
||
|
public class MiddleScrollRect : ScrollRect
|
||
|
{
|
||
|
public override void OnBeginDrag(PointerEventData eventData)
|
||
|
{
|
||
|
if (eventData.button != PointerEventData.InputButton.Middle) return;
|
||
|
eventData.button = PointerEventData.InputButton.Left;
|
||
|
base.OnBeginDrag(eventData);
|
||
|
}
|
||
|
|
||
|
public override void OnEndDrag(PointerEventData eventData)
|
||
|
{
|
||
|
if (eventData.button != PointerEventData.InputButton.Middle) return;
|
||
|
eventData.button = PointerEventData.InputButton.Left;
|
||
|
base.OnEndDrag(eventData);
|
||
|
}
|
||
|
|
||
|
public override void OnDrag(PointerEventData eventData)
|
||
|
{
|
||
|
if (eventData.button != PointerEventData.InputButton.Middle) return;
|
||
|
eventData.button = PointerEventData.InputButton.Left;
|
||
|
base.OnDrag(eventData);
|
||
|
}
|
||
|
}
|
||
|
}
|