修正异步创建子Widget时SetParent的问题

修正异步创建子Widget时SetParent的问题
This commit is contained in:
ALEXTANG
2023-11-15 14:06:49 +08:00
parent 2870383afe
commit 623d301e41

View File

@@ -340,7 +340,7 @@ namespace TEngine
public async UniTask<T> CreateWidgetByPathAsync<T>(Transform parentTrans, string assetLocation, bool visible = true) where T : UIWidget, new()
{
GameObject goInst = await GameModule.Resource.LoadAssetAsync<GameObject>(assetLocation, gameObject.GetCancellationTokenOnDestroy());
goInst.transform.SetParent(parentTrans);
goInst.transform.SetParent(parentTrans, false);
return CreateWidget<T>(goInst, visible);
}