2023-02-05 03:05:36 +00:00
|
|
|
using UnityEngine.EventSystems;
|
|
|
|
using UnityEngine.UI;
|
|
|
|
|
|
|
|
namespace HeavenStudio.Editor.Track
|
|
|
|
{
|
|
|
|
public class MiddleScrollRect : ScrollRect
|
|
|
|
{
|
|
|
|
public override void OnBeginDrag(PointerEventData eventData)
|
|
|
|
{
|
2023-02-05 19:48:49 +00:00
|
|
|
if (Conductor.instance.isPlaying) return;
|
2023-02-05 03:05:36 +00:00
|
|
|
if (eventData.button != PointerEventData.InputButton.Middle) return;
|
|
|
|
eventData.button = PointerEventData.InputButton.Left;
|
|
|
|
base.OnBeginDrag(eventData);
|
|
|
|
}
|
|
|
|
|
|
|
|
public override void OnEndDrag(PointerEventData eventData)
|
|
|
|
{
|
2023-02-05 19:48:49 +00:00
|
|
|
if (Conductor.instance.isPlaying) return;
|
2023-02-05 03:05:36 +00:00
|
|
|
if (eventData.button != PointerEventData.InputButton.Middle) return;
|
|
|
|
eventData.button = PointerEventData.InputButton.Left;
|
|
|
|
base.OnEndDrag(eventData);
|
|
|
|
}
|
|
|
|
|
|
|
|
public override void OnDrag(PointerEventData eventData)
|
|
|
|
{
|
2023-02-05 19:48:49 +00:00
|
|
|
if (Conductor.instance.isPlaying) return;
|
2023-02-05 03:05:36 +00:00
|
|
|
if (eventData.button != PointerEventData.InputButton.Middle) return;
|
|
|
|
eventData.button = PointerEventData.InputButton.Left;
|
|
|
|
base.OnDrag(eventData);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|