commit
bf59edf11d
|
@ -10,7 +10,7 @@ namespace UnityEngine.UI.Extensions
|
|||
|
||||
[RequireComponent(typeof(ScrollRect))]
|
||||
[AddComponentMenu("Layout/Extensions/Horizontal Scroll Snap")]
|
||||
public class HorizontalScrollSnap : ScrollSnapBase, IEndDragHandler
|
||||
public class HorizontalScrollSnap : ScrollSnapBase
|
||||
{
|
||||
void Start()
|
||||
{
|
||||
|
@ -235,13 +235,11 @@ namespace UnityEngine.UI.Extensions
|
|||
GoToScreen(StartingScreen);
|
||||
}
|
||||
|
||||
#region Interfaces
|
||||
|
||||
/// <summary>
|
||||
/// Release screen to swipe
|
||||
/// </summary>
|
||||
/// <param name="eventData"></param>
|
||||
public void OnEndDrag(PointerEventData eventData)
|
||||
public override void OnEndDrag(PointerEventData eventData)
|
||||
{
|
||||
_pointerDown = false;
|
||||
|
||||
|
@ -307,7 +305,5 @@ namespace UnityEngine.UI.Extensions
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ using UnityEngine.EventSystems;
|
|||
|
||||
namespace UnityEngine.UI.Extensions
|
||||
{
|
||||
public class ScrollSnapBase : MonoBehaviour, IBeginDragHandler, IDragHandler, IScrollSnap
|
||||
public class ScrollSnapBase : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDragHandler, IScrollSnap
|
||||
{
|
||||
internal Rect panelDimensions;
|
||||
internal RectTransform _screensContainer;
|
||||
|
@ -582,6 +582,8 @@ namespace UnityEngine.UI.Extensions
|
|||
_lerp = false;
|
||||
}
|
||||
|
||||
public virtual void OnEndDrag(PointerEventData eventData) { }
|
||||
|
||||
#endregion
|
||||
|
||||
#region IScrollSnap Interface
|
||||
|
@ -609,6 +611,7 @@ namespace UnityEngine.UI.Extensions
|
|||
{
|
||||
GoToScreen(page);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ namespace UnityEngine.UI.Extensions
|
|||
{
|
||||
[RequireComponent(typeof(ScrollRect))]
|
||||
[AddComponentMenu("Layout/Extensions/Vertical Scroll Snap")]
|
||||
public class VerticalScrollSnap : ScrollSnapBase, IEndDragHandler
|
||||
public class VerticalScrollSnap : ScrollSnapBase
|
||||
{
|
||||
void Start()
|
||||
{
|
||||
|
@ -228,12 +228,11 @@ namespace UnityEngine.UI.Extensions
|
|||
if(RestartOnEnable) GoToScreen(StartingScreen);
|
||||
}
|
||||
|
||||
#region Interfaces
|
||||
/// <summary>
|
||||
/// Release screen to swipe
|
||||
/// </summary>
|
||||
/// <param name="eventData"></param>
|
||||
public void OnEndDrag(PointerEventData eventData)
|
||||
public override void OnEndDrag(PointerEventData eventData)
|
||||
{
|
||||
_pointerDown = false;
|
||||
|
||||
|
@ -298,6 +297,5 @@ namespace UnityEngine.UI.Extensions
|
|||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue