Clean-up of ScrollSnapBase

pull/413/head
Simon Jackson 2023-01-01 13:22:53 +00:00
parent c61e5b7e7c
commit eceaa87e93
1 changed files with 11 additions and 15 deletions

View File

@ -13,9 +13,7 @@ namespace UnityEngine.UI.Extensions
internal Rect panelDimensions; internal Rect panelDimensions;
internal RectTransform _screensContainer; internal RectTransform _screensContainer;
internal bool _isVertical; internal bool _isVertical;
internal int _screens = 1; internal int _screens = 1;
internal float _scrollStartPosition; internal float _scrollStartPosition;
internal float _childSize; internal float _childSize;
private float _childPos, _maskSize; private float _childPos, _maskSize;
@ -26,7 +24,6 @@ namespace UnityEngine.UI.Extensions
internal bool _pointerDown = false; internal bool _pointerDown = false;
internal bool _settled = true; internal bool _settled = true;
internal Vector3 _startPosition = new Vector3(); internal Vector3 _startPosition = new Vector3();
[Tooltip("The currently active page")]
internal int _currentPage; internal int _currentPage;
internal int _previousPage; internal int _previousPage;
internal int _halfNoVisibleItems; internal int _halfNoVisibleItems;
@ -67,13 +64,13 @@ namespace UnityEngine.UI.Extensions
public float transitionSpeed = 7.5f; public float transitionSpeed = 7.5f;
[Tooltip("Hard Swipe forces to swiping to the next / previous page (optional)")] [Tooltip("Hard Swipe forces to swiping to the next / previous page (optional)")]
public Boolean UseHardSwipe = false; public bool UseHardSwipe = false;
[Tooltip("Fast Swipe makes swiping page next / previous (optional)")] [Tooltip("Fast Swipe makes swiping page next / previous (optional)")]
public Boolean UseFastSwipe = false; public bool UseFastSwipe = false;
[Tooltip("Swipe Delta Threshold looks at the speed of input to decide if a swipe will be initiated (optional)")] [Tooltip("Swipe Delta Threshold looks at the speed of input to decide if a swipe will be initiated (optional)")]
public Boolean UseSwipeDeltaThreshold = false; public bool UseSwipeDeltaThreshold = false;
[Tooltip("Offset for how far a swipe has to travel to initiate a page change (optional)")] [Tooltip("Offset for how far a swipe has to travel to initiate a page change (optional)")]
public int FastSwipeThreshold = 100; public int FastSwipeThreshold = 100;
@ -85,7 +82,7 @@ namespace UnityEngine.UI.Extensions
public float SwipeDeltaThreshold = 5.0f; public float SwipeDeltaThreshold = 5.0f;
[Tooltip("Use time scale instead of unscaled time (optional)")] [Tooltip("Use time scale instead of unscaled time (optional)")]
public Boolean UseTimeScale = true; public bool UseTimeScale = true;
[Tooltip("The visible bounds area, controls which items are visible/enabled. *Note Should use a RectMask. (optional)")] [Tooltip("The visible bounds area, controls which items are visible/enabled. *Note Should use a RectMask. (optional)")]
public RectTransform MaskArea; public RectTransform MaskArea;
@ -167,7 +164,6 @@ namespace UnityEngine.UI.Extensions
private SelectionChangeEndEvent m_OnSelectionChangeEndEvent = new SelectionChangeEndEvent(); private SelectionChangeEndEvent m_OnSelectionChangeEndEvent = new SelectionChangeEndEvent();
public SelectionChangeEndEvent OnSelectionChangeEndEvent { get { return m_OnSelectionChangeEndEvent; } set { m_OnSelectionChangeEndEvent = value; } } public SelectionChangeEndEvent OnSelectionChangeEndEvent { get { return m_OnSelectionChangeEndEvent; } set { m_OnSelectionChangeEndEvent = value; } }
// Use this for initialization
void Awake() void Awake()
{ {
if (_scroll_rect == null) if (_scroll_rect == null)