Merged in development (pull request #85)
PaginationManager Fork (development branch) Approved-by: Simon Jacksonpull/413/head
commit
7b423e2e39
|
@ -1,4 +1,4 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
/// Credit Brogan King (@BroganKing)
|
/// Credit Brogan King (@BroganKing)
|
||||||
/// Original Sourced from - https://bitbucket.org/UnityUIExtensions/unity-ui-extensions/issues/158/pagination-script
|
/// Original Sourced from - https://bitbucket.org/UnityUIExtensions/unity-ui-extensions/issues/158/pagination-script
|
||||||
|
|
||||||
|
@ -44,6 +44,15 @@ namespace UnityEngine.UI.Extensions
|
||||||
scrollSnap.OnSelectionPageChangedEvent.AddListener(SetToggleGraphics);
|
scrollSnap.OnSelectionPageChangedEvent.AddListener(SetToggleGraphics);
|
||||||
scrollSnap.OnSelectionChangeEndEvent.AddListener(OnPageChangeEnd);
|
scrollSnap.OnSelectionChangeEndEvent.AddListener(OnPageChangeEnd);
|
||||||
|
|
||||||
|
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
|
// add selectables to list
|
||||||
m_PaginationChildren = GetComponentsInChildren<Toggle>().ToList<Toggle>();
|
m_PaginationChildren = GetComponentsInChildren<Toggle>().ToList<Toggle>();
|
||||||
for (int i = 0; i < m_PaginationChildren.Count; i++)
|
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");
|
Debug.LogWarning("Uneven pagination icon to page count");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Calling from other scripts if you need to change screens programmatically
|
/// Calling from other scripts if you need to change screens programmatically
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
Loading…
Reference in New Issue