From 93e36943a221d0731ddc662f79a226b444b21048 Mon Sep 17 00:00:00 2001 From: "Simon (darkside) Jackson" Date: Fri, 23 Oct 2020 12:04:11 +0100 Subject: [PATCH 1/2] Refactored and extended the ContentScrollSnap control * Added protection against errors and empty scrollrect content * Added new SetNewItems function to add children programmatically to the control and reset accordingly --- .../Layout/ContentScrollSnapHorizontal.cs | 75 ++++++++++++++++--- Runtime/Scripts/Utilities/ExtentionMethods.cs | 20 ++++- 2 files changed, 84 insertions(+), 11 deletions(-) diff --git a/Runtime/Scripts/Layout/ContentScrollSnapHorizontal.cs b/Runtime/Scripts/Layout/ContentScrollSnapHorizontal.cs index 7a65c69..8f732ca 100644 --- a/Runtime/Scripts/Layout/ContentScrollSnapHorizontal.cs +++ b/Runtime/Scripts/Layout/ContentScrollSnapHorizontal.cs @@ -185,11 +185,60 @@ namespace UnityEngine.UI.Extensions if (prevButton) prevButton.GetComponent