diff --git a/Runtime/Scripts/Layout/HorizontalScrollSnap.cs b/Runtime/Scripts/Layout/HorizontalScrollSnap.cs index 846d2a3..59877a0 100644 --- a/Runtime/Scripts/Layout/HorizontalScrollSnap.cs +++ b/Runtime/Scripts/Layout/HorizontalScrollSnap.cs @@ -223,12 +223,21 @@ namespace UnityEngine.UI.Extensions /// /// used for changing / updating between screen resolutions /// - public void UpdateLayout() + public void UpdateLayout(bool resetPositionToStart = false) { _lerp = false; DistributePages(); + + if (resetPositionToStart) + { + _currentPage = StartingScreen; + } + if (MaskArea) + { UpdateVisible(); + } + SetScrollContainerPosition(); OnCurrentScreenChange(_currentPage); } diff --git a/Runtime/Scripts/Layout/VerticalScrollSnap.cs b/Runtime/Scripts/Layout/VerticalScrollSnap.cs index 8690856..4642241 100644 --- a/Runtime/Scripts/Layout/VerticalScrollSnap.cs +++ b/Runtime/Scripts/Layout/VerticalScrollSnap.cs @@ -218,11 +218,21 @@ namespace UnityEngine.UI.Extensions /// /// used for changing / updating between screen resolutions /// - public void UpdateLayout() + public void UpdateLayout(bool resetPositionToStart = false) { _lerp = false; DistributePages(); - if (MaskArea) UpdateVisible(); + + if (resetPositionToStart) + { + _currentPage = StartingScreen; + } + + if (MaskArea) + { + UpdateVisible(); + } + SetScrollContainerPosition(); OnCurrentScreenChange(_currentPage); }