Update to force Enumerated start for Accordion elements

Resolves: https://github.com/Unity-UI-Extensions/com.unity.uiextensions/issues/455
pull/460/head
SimonDarksideJ 2023-11-26 13:41:48 +00:00
parent b615c4b681
commit 9c7a59c9f2
1 changed files with 182 additions and 174 deletions

View File

@ -2,6 +2,7 @@
///Sourced from - http://forum.unity3d.com/threads/accordion-type-layout.271818/
using System;
using System.Collections;
using UnityEngine.UI.Extensions.Tweens;
namespace UnityEngine.UI.Extensions
@ -45,6 +46,13 @@ namespace UnityEngine.UI.Extensions
this.onValueChanged.AddListener(OnValueChanged);
}
private new IEnumerator Start()
{
base.Start();
yield return new WaitForEndOfFrame(); // Wait for the first frame
OnValueChanged(this.isOn);
}
#if UNITY_EDITOR
protected override void OnValidate()
{