Reversed clean-up, was actually used :S

--HG--
branch : develop_5.3
pull/413/head
Simon Jackson 2016-12-30 15:56:00 +00:00
parent df9ea42e02
commit b169e98452
1 changed files with 13 additions and 2 deletions

View File

@ -4,7 +4,7 @@ using UnityEngine.EventSystems;
namespace UnityEngine.UI.Extensions
{
public class ScrollSnapBase : MonoBehaviour, IBeginDragHandler, IDragHandler
public class ScrollSnapBase : MonoBehaviour, IBeginDragHandler, IDragHandler, IPointerDownHandler, IPointerUpHandler
{
internal RectTransform _screensContainer;
internal bool isVertical;
@ -18,6 +18,7 @@ namespace UnityEngine.UI.Extensions
internal ScrollRect _scroll_rect;
internal Vector3 _lerp_target;
internal bool _lerp;
internal bool _pointerDown = false;
internal Vector3 _startPosition = new Vector3();
[Tooltip("The currently active page")]
internal int _currentPage;
@ -316,7 +317,7 @@ namespace UnityEngine.UI.Extensions
}
/// <summary>
/// Event fires when the user starts to change the page, either via swipe or button
/// Event fires when the user starts to change the page, either via swipe or button.
/// </summary>
internal void StartScreenChange()
{
@ -358,6 +359,16 @@ namespace UnityEngine.UI.Extensions
{
_lerp = false;
}
public void OnPointerDown(PointerEventData eventData)
{
_pointerDown = true;
}
public void OnPointerUp(PointerEventData eventData)
{
_pointerDown = false;
}
#endregion
}
}