Added argument to the UpdateLayout method for the HSS/VSS to move to a new starting page
Resolves: https://github.com/Unity-UI-Extensions/com.unity.uiextensions/issues/451pull/460/head
parent
9c7a59c9f2
commit
a47d694796
|
@ -223,12 +223,21 @@ namespace UnityEngine.UI.Extensions
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// used for changing / updating between screen resolutions
|
/// used for changing / updating between screen resolutions
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void UpdateLayout()
|
public void UpdateLayout(bool resetPositionToStart = false)
|
||||||
{
|
{
|
||||||
_lerp = false;
|
_lerp = false;
|
||||||
DistributePages();
|
DistributePages();
|
||||||
|
|
||||||
|
if (resetPositionToStart)
|
||||||
|
{
|
||||||
|
_currentPage = StartingScreen;
|
||||||
|
}
|
||||||
|
|
||||||
if (MaskArea)
|
if (MaskArea)
|
||||||
|
{
|
||||||
UpdateVisible();
|
UpdateVisible();
|
||||||
|
}
|
||||||
|
|
||||||
SetScrollContainerPosition();
|
SetScrollContainerPosition();
|
||||||
OnCurrentScreenChange(_currentPage);
|
OnCurrentScreenChange(_currentPage);
|
||||||
}
|
}
|
||||||
|
|
|
@ -218,11 +218,21 @@ namespace UnityEngine.UI.Extensions
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// used for changing / updating between screen resolutions
|
/// used for changing / updating between screen resolutions
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void UpdateLayout()
|
public void UpdateLayout(bool resetPositionToStart = false)
|
||||||
{
|
{
|
||||||
_lerp = false;
|
_lerp = false;
|
||||||
DistributePages();
|
DistributePages();
|
||||||
if (MaskArea) UpdateVisible();
|
|
||||||
|
if (resetPositionToStart)
|
||||||
|
{
|
||||||
|
_currentPage = StartingScreen;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (MaskArea)
|
||||||
|
{
|
||||||
|
UpdateVisible();
|
||||||
|
}
|
||||||
|
|
||||||
SetScrollContainerPosition();
|
SetScrollContainerPosition();
|
||||||
OnCurrentScreenChange(_currentPage);
|
OnCurrentScreenChange(_currentPage);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue