Skip to content

Commit 623d301

Browse files
committed
修正异步创建子Widget时SetParent的问题
修正异步创建子Widget时SetParent的问题
1 parent 2870383 commit 623d301

File tree

1 file changed

+1
-1
lines changed
  • UnityProject/Assets/TEngine/Runtime/Modules/UIModule

1 file changed

+1
-1
lines changed

UnityProject/Assets/TEngine/Runtime/Modules/UIModule/UIBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ protected void RemoveAllUIEvent()
340340
public async UniTask<T> CreateWidgetByPathAsync<T>(Transform parentTrans, string assetLocation, bool visible = true) where T : UIWidget, new()
341341
{
342342
GameObject goInst = await GameModule.Resource.LoadAssetAsync<GameObject>(assetLocation, gameObject.GetCancellationTokenOnDestroy());
343-
goInst.transform.SetParent(parentTrans);
343+
goInst.transform.SetParent(parentTrans, false);
344344
return CreateWidget<T>(goInst, visible);
345345
}
346346

0 commit comments

Comments
 (0)