mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-07 16:45:10 +00:00
修正异步创建子Widget时SetParent的问题
修正异步创建子Widget时SetParent的问题
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user