Added option to NOT restart control
Also switched to the InitialiseChildObjectsFromScene (whoops)release
parent
f89702ddc6
commit
966f82da3f
|
@ -195,12 +195,12 @@ namespace UnityEngine.UI.Extensions
|
||||||
|
|
||||||
private void OnEnable()
|
private void OnEnable()
|
||||||
{
|
{
|
||||||
InitialiseChildObjects();
|
InitialiseChildObjectsFromScene();
|
||||||
DistributePages();
|
DistributePages();
|
||||||
if (MaskArea) UpdateVisible();
|
if (MaskArea) UpdateVisible();
|
||||||
|
|
||||||
if(JumpOnEnable) SetScrollContainerPosition();
|
if (JumpOnEnable || !RestartOnEnable) SetScrollContainerPosition();
|
||||||
GoToScreen(StartingScreen);
|
if (RestartOnEnable) GoToScreen(StartingScreen);
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Interfaces
|
#region Interfaces
|
||||||
|
|
|
@ -93,6 +93,9 @@ namespace UnityEngine.UI.Extensions
|
||||||
[Tooltip("By default the container will lerp to the start when enabled in the scene, this option overrides this and forces it to simply jump without lerping")]
|
[Tooltip("By default the container will lerp to the start when enabled in the scene, this option overrides this and forces it to simply jump without lerping")]
|
||||||
public bool JumpOnEnable = false;
|
public bool JumpOnEnable = false;
|
||||||
|
|
||||||
|
[Tooltip("By default the container will return to the original starting page when enabled, this option overrides this behaviour and stays on the current selection")]
|
||||||
|
public bool RestartOnEnable = false;
|
||||||
|
|
||||||
[Tooltip("(Experimental)\nBy default, child array objects will use the parent transform\nHowever you can disable this for some interesting effects")]
|
[Tooltip("(Experimental)\nBy default, child array objects will use the parent transform\nHowever you can disable this for some interesting effects")]
|
||||||
public bool UseParentTransform = true;
|
public bool UseParentTransform = true;
|
||||||
|
|
||||||
|
|
|
@ -195,12 +195,12 @@ namespace UnityEngine.UI.Extensions
|
||||||
|
|
||||||
private void OnEnable()
|
private void OnEnable()
|
||||||
{
|
{
|
||||||
InitialiseChildObjects();
|
InitialiseChildObjectsFromScene();
|
||||||
DistributePages();
|
DistributePages();
|
||||||
if (MaskArea) UpdateVisible();
|
if (MaskArea) UpdateVisible();
|
||||||
|
|
||||||
if (JumpOnEnable) SetScrollContainerPosition();
|
if (JumpOnEnable || !RestartOnEnable) SetScrollContainerPosition();
|
||||||
GoToScreen(StartingScreen);
|
if(RestartOnEnable) GoToScreen(StartingScreen);
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Interfaces
|
#region Interfaces
|
||||||
|
|
Loading…
Reference in New Issue