Merged in development (pull request #85)

PaginationManager Fork (development branch)

Approved-by: Simon Jackson
pull/413/head
Harris Bright 2020-07-15 01:47:05 +00:00 committed by Simon Jackson
commit 7b423e2e39
1 changed files with 12 additions and 4 deletions

View File

@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
/// Credit Brogan King (@BroganKing)
/// Original Sourced from - https://bitbucket.org/UnityUIExtensions/unity-ui-extensions/issues/158/pagination-script
@ -44,7 +44,16 @@ namespace UnityEngine.UI.Extensions
scrollSnap.OnSelectionPageChangedEvent.AddListener(SetToggleGraphics);
scrollSnap.OnSelectionChangeEndEvent.AddListener(OnPageChangeEnd);
// add selectables to list
ResetPaginationChildren();
}
/// <summary>
/// Remake the internal list of child toggles (m_PaginationChildren).
/// Used after adding/removing a toggle.
/// </summary>
public void ResetPaginationChildren()
{
// add selectables to list
m_PaginationChildren = GetComponentsInChildren<Toggle>().ToList<Toggle>();
for (int i = 0; i < m_PaginationChildren.Count; i++)
{
@ -61,7 +70,6 @@ namespace UnityEngine.UI.Extensions
Debug.LogWarning("Uneven pagination icon to page count");
}
/// <summary>
/// Calling from other scripts if you need to change screens programmatically
/// </summary>
@ -128,4 +136,4 @@ namespace UnityEngine.UI.Extensions
isAClick = false;
}
}
}
}