Fixed public GoToScreen call to only raise events internally (not multiple)
parent
56391827d6
commit
263368ba8d
|
@ -238,7 +238,7 @@ namespace UnityEngine.UI.Extensions
|
|||
if (JumpOnEnable || !RestartOnEnable)
|
||||
SetScrollContainerPosition();
|
||||
if (RestartOnEnable)
|
||||
GoToScreen(StartingScreen);
|
||||
GoToScreen(StartingScreen, true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -357,7 +357,7 @@ namespace UnityEngine.UI.Extensions
|
|||
/// *Note, this is based on a 0 starting index - 0 to x
|
||||
/// </summary>
|
||||
/// <param name="screenIndex">0 starting index of page to jump to</param>
|
||||
public void GoToScreen(int screenIndex)
|
||||
public void GoToScreen(int screenIndex, bool local = false)
|
||||
{
|
||||
if (screenIndex <= _screens - 1 && screenIndex >= 0)
|
||||
{
|
||||
|
@ -366,7 +366,7 @@ namespace UnityEngine.UI.Extensions
|
|||
_lerp = true;
|
||||
CurrentPage = screenIndex;
|
||||
GetPositionforPage(_currentPage, ref _lerp_target);
|
||||
ScreenChange();
|
||||
if(local) ScreenChange();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -623,7 +623,7 @@ namespace UnityEngine.UI.Extensions
|
|||
/// </summary>
|
||||
public void ChangePage(int page)
|
||||
{
|
||||
GoToScreen(page);
|
||||
GoToScreen(page, true);
|
||||
}
|
||||
|
||||
public void OnPointerClick(PointerEventData eventData)
|
||||
|
|
|
@ -228,10 +228,13 @@ namespace UnityEngine.UI.Extensions
|
|||
{
|
||||
InitialiseChildObjectsFromScene();
|
||||
DistributePages();
|
||||
if (MaskArea) UpdateVisible();
|
||||
if (MaskArea)
|
||||
UpdateVisible();
|
||||
|
||||
if (JumpOnEnable || !RestartOnEnable) SetScrollContainerPosition();
|
||||
if(RestartOnEnable) GoToScreen(StartingScreen);
|
||||
if (JumpOnEnable || !RestartOnEnable)
|
||||
SetScrollContainerPosition();
|
||||
if (RestartOnEnable)
|
||||
GoToScreen(StartingScreen, true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
Loading…
Reference in New Issue