From d0fbb28b055c1ba6a4a9e4e86055f4176782d83e Mon Sep 17 00:00:00 2001 From: Simon Jackson Date: Sat, 23 Apr 2022 21:24:18 +0100 Subject: [PATCH] Resolves #397 Moved OnValidate checks which redraw the component to the RectTransformDimensionsCHanged event --- Runtime/Scripts/Controls/Stepper.cs | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/Runtime/Scripts/Controls/Stepper.cs b/Runtime/Scripts/Controls/Stepper.cs index 6d920d8..99f6cb6 100644 --- a/Runtime/Scripts/Controls/Stepper.cs +++ b/Runtime/Scripts/Controls/Stepper.cs @@ -9,6 +9,7 @@ using UnityEngine.EventSystems; namespace UnityEngine.UI.Extensions { // Stepper control + [ExecuteInEditMode] [AddComponentMenu("UI/Extensions/Stepper")] [RequireComponent(typeof(RectTransform))] public class Stepper : UIBehaviour @@ -89,28 +90,6 @@ namespace UnityEngine.UI.Extensions 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() { StartCoroutine(DelayedInit());