From b169e984522292b518a128301f418d5b025c6fa7 Mon Sep 17 00:00:00 2001 From: Simon Jackson Date: Fri, 30 Dec 2016 15:56:00 +0000 Subject: [PATCH] Reversed clean-up, was actually used :S --HG-- branch : develop_5.3 --- Scripts/Layout/ScrollSnapBase.cs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Scripts/Layout/ScrollSnapBase.cs b/Scripts/Layout/ScrollSnapBase.cs index 59cdd07..466beb6 100644 --- a/Scripts/Layout/ScrollSnapBase.cs +++ b/Scripts/Layout/ScrollSnapBase.cs @@ -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 } /// - /// 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. /// 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 } } \ No newline at end of file