From 8c2d10dccc81ef8c47ae08a0584e1393db392446 Mon Sep 17 00:00:00 2001 From: Simon Jackson Date: Sun, 9 Jul 2017 10:17:32 +0100 Subject: [PATCH] Added CurrentPageObject functions to return the Transform of the currently selected page. --- Scripts/Layout/ScrollSnapBase.cs | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/Scripts/Layout/ScrollSnapBase.cs b/Scripts/Layout/ScrollSnapBase.cs index 3cd3243..b7aea59 100644 --- a/Scripts/Layout/ScrollSnapBase.cs +++ b/Scripts/Layout/ScrollSnapBase.cs @@ -476,7 +476,25 @@ namespace UnityEngine.UI.Extensions _moveStarted = false; } - #region Interfaces + /// + /// Returns the Transform of the Currentpage + /// + /// Currently selected Page Transform + public Transform CurrentPageObject() + { + return _screensContainer.GetChild(CurrentPage); + } + + /// + /// Returns the Transform of the Currentpage in an out param for performance + /// + /// Currently selected Page Transform + public void CurrentPageObject(out Transform returnObject) + { + returnObject = _screensContainer.GetChild(CurrentPage); + } + + #region Drag Interfaces /// /// Touch screen to start swiping ///