mirror of
https://github.com/GrahamKracker/UnityExplorer.git
synced 2025-07-17 08:37:49 +08:00
Don't use WaitForEndOfFrame in SrollPool init coroutine
This commit is contained in:
@ -193,12 +193,11 @@ namespace UnityExplorer.UI.Widgets
|
|||||||
RuntimeProvider.Instance.StartCoroutine(InitCoroutine(onHeightChangedListener));
|
RuntimeProvider.Instance.StartCoroutine(InitCoroutine(onHeightChangedListener));
|
||||||
}
|
}
|
||||||
|
|
||||||
private WaitForEndOfFrame waitForEndOfFrame = new WaitForEndOfFrame();
|
|
||||||
|
|
||||||
private IEnumerator InitCoroutine(Action onHeightChangedListener)
|
private IEnumerator InitCoroutine(Action onHeightChangedListener)
|
||||||
{
|
{
|
||||||
ScrollRect.content.anchoredPosition = Vector2.zero;
|
ScrollRect.content.anchoredPosition = Vector2.zero;
|
||||||
yield return waitForEndOfFrame ?? (waitForEndOfFrame = new WaitForEndOfFrame());
|
yield return null;
|
||||||
|
yield return null;
|
||||||
|
|
||||||
LayoutRebuilder.ForceRebuildLayoutImmediate(Content);
|
LayoutRebuilder.ForceRebuildLayoutImmediate(Content);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user