From 162bb7ca56fcbc3d76f030652f6196a72ddadf2a Mon Sep 17 00:00:00 2001 From: "Simon (darkside) Jackson" Date: Sun, 19 Jan 2020 10:50:39 +0000 Subject: [PATCH] Fixed issues with HSS/VSS in conjunction with the UI_Infinite Scroll * Vertical Scroller now works with infinite ScrollSnapBase * Resolved issue with Procedural scrollers used with infinite ScrollSnapBase * Resolved issue with UI Infinite scroll which couldn't handle content in reverse order --- Scripts/Layout/ScrollSnapBase.cs | 26 ++++++++++++++++++-------- Scripts/Utilities/UI_InfiniteScroll.cs | 10 +++++++++- 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/Scripts/Layout/ScrollSnapBase.cs b/Scripts/Layout/ScrollSnapBase.cs index bf4937a..bb945cc 100644 --- a/Scripts/Layout/ScrollSnapBase.cs +++ b/Scripts/Layout/ScrollSnapBase.cs @@ -31,7 +31,7 @@ namespace UnityEngine.UI.Extensions internal int _previousPage; internal int _halfNoVisibleItems; internal bool _moveStarted; - internal bool _isInfinate; // Is a UI Infinite scroller attached to the control + internal bool _isInfinite; // Is a UI Infinite scroller attached to the control internal int _infiniteWindow; // The infinite window the control is in internal float _infiniteOffset; // How much to offset a repositioning private int _bottomItem, _topItem; @@ -82,8 +82,8 @@ namespace UnityEngine.UI.Extensions [Tooltip("Threshold for swipe speed to initiate a swipe, below threshold will return to closest page (optional)")] public float SwipeDeltaThreshold = 5.0f; - [Tooltip("Use time scale instead of unscaled time (optional)")] - public Boolean UseTimeScale = true; + [Tooltip("Use time scale instead of unscaled time (optional)")] + public Boolean UseTimeScale = true; [Tooltip("The visible bounds area, controls which items are visible/enabled. *Note Should use a RectMask. (optional)")] public RectTransform MaskArea; @@ -100,7 +100,7 @@ namespace UnityEngine.UI.Extensions internal set { - if (_isInfinate) + if (_isInfinite) { //Work out which infinite window we are in float infWindow = (float)value / (float)_screensContainer.childCount; @@ -199,7 +199,7 @@ namespace UnityEngine.UI.Extensions if (PrevButton) PrevButton.GetComponent