Resolves #397
Moved OnValidate checks which redraw the component to the RectTransformDimensionsCHanged eventpull/413/head
parent
fc6ea6089d
commit
d0fbb28b05
|
@ -9,6 +9,7 @@ using UnityEngine.EventSystems;
|
||||||
namespace UnityEngine.UI.Extensions
|
namespace UnityEngine.UI.Extensions
|
||||||
{
|
{
|
||||||
// Stepper control
|
// Stepper control
|
||||||
|
[ExecuteInEditMode]
|
||||||
[AddComponentMenu("UI/Extensions/Stepper")]
|
[AddComponentMenu("UI/Extensions/Stepper")]
|
||||||
[RequireComponent(typeof(RectTransform))]
|
[RequireComponent(typeof(RectTransform))]
|
||||||
public class Stepper : UIBehaviour
|
public class Stepper : UIBehaviour
|
||||||
|
@ -89,28 +90,6 @@ namespace UnityEngine.UI.Extensions
|
||||||
protected Stepper()
|
protected Stepper()
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
#if UNITY_EDITOR
|
|
||||||
protected override void OnValidate()
|
|
||||||
{
|
|
||||||
base.OnValidate();
|
|
||||||
|
|
||||||
RecreateSprites(sides);
|
|
||||||
if (separator)
|
|
||||||
LayoutSides();
|
|
||||||
|
|
||||||
if (!wrap)
|
|
||||||
{
|
|
||||||
DisableAtExtremes(sides);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
protected override void Start()
|
|
||||||
{
|
|
||||||
if (isActiveAndEnabled)
|
|
||||||
StartCoroutine(DelayedInit());
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void OnEnable()
|
protected override void OnEnable()
|
||||||
{
|
{
|
||||||
StartCoroutine(DelayedInit());
|
StartCoroutine(DelayedInit());
|
||||||
|
|
Loading…
Reference in New Issue