Skip to content

Instantly share code, notes, and snippets.

@irfanbaysal
Created January 27, 2023 05:52
Show Gist options
  • Save irfanbaysal/200ec420d3e8e0408b741bd0777c025e to your computer and use it in GitHub Desktop.
Save irfanbaysal/200ec420d3e8e0408b741bd0777c025e to your computer and use it in GitHub Desktop.
Rect Transform Sibling Update
private async UniTask UpdateSibling(int siblingIndex)
{
RectTransform.SetSiblingIndex(siblingIndex);
await UniTask.Yield(cancellationToken: this.GetCancellationTokenOnDestroy());
LayoutRebuilder.ForceRebuildLayoutImmediate(RectTransform);
Canvas.ForceUpdateCanvases();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment