Don't use WaitForEndOfFrame in SrollPool init coroutine

This commit is contained in:
Sinai 2021-06-22 19:45:57 +10:00
parent 94ec1c4908
commit 6033200579

View File

@ -193,12 +193,11 @@ namespace UnityExplorer.UI.Widgets
RuntimeProvider.Instance.StartCoroutine(InitCoroutine(onHeightChangedListener));
}
private WaitForEndOfFrame waitForEndOfFrame = new WaitForEndOfFrame();
private IEnumerator InitCoroutine(Action onHeightChangedListener)
{
ScrollRect.content.anchoredPosition = Vector2.zero;
yield return waitForEndOfFrame ?? (waitForEndOfFrame = new WaitForEndOfFrame());
yield return null;
yield return null;
LayoutRebuilder.ForceRebuildLayoutImmediate(Content);