Added option to NOT restart control

Also switched to the InitialiseChildObjectsFromScene (whoops)
release
Simon Jackson 2017-03-12 15:29:59 +00:00
parent f89702ddc6
commit 966f82da3f
3 changed files with 9 additions and 6 deletions

View File

@ -195,12 +195,12 @@ namespace UnityEngine.UI.Extensions
private void OnEnable()
{
InitialiseChildObjects();
InitialiseChildObjectsFromScene();
DistributePages();
if (MaskArea) UpdateVisible();
if(JumpOnEnable) SetScrollContainerPosition();
GoToScreen(StartingScreen);
if (JumpOnEnable || !RestartOnEnable) SetScrollContainerPosition();
if (RestartOnEnable) GoToScreen(StartingScreen);
}
#region Interfaces

View File

@ -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")]
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")]
public bool UseParentTransform = true;

View File

@ -195,12 +195,12 @@ namespace UnityEngine.UI.Extensions
private void OnEnable()
{
InitialiseChildObjects();
InitialiseChildObjectsFromScene();
DistributePages();
if (MaskArea) UpdateVisible();
if (JumpOnEnable) SetScrollContainerPosition();
GoToScreen(StartingScreen);
if (JumpOnEnable || !RestartOnEnable) SetScrollContainerPosition();
if(RestartOnEnable) GoToScreen(StartingScreen);
}
#region Interfaces