From f8797538fdf91c739c9cd6fee5c7cb872380374d Mon Sep 17 00:00:00 2001 From: ALEXTANG <574809918@qq.com> Date: Fri, 3 Nov 2023 09:55:36 +0800 Subject: [PATCH] Update UIBase.cs --- .../Runtime/Modules/UIModule/UIBase.cs | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/UnityProject/Assets/TEngine/Runtime/Modules/UIModule/UIBase.cs b/UnityProject/Assets/TEngine/Runtime/Modules/UIModule/UIBase.cs index f060bc37..b22bac6b 100644 --- a/UnityProject/Assets/TEngine/Runtime/Modules/UIModule/UIBase.cs +++ b/UnityProject/Assets/TEngine/Runtime/Modules/UIModule/UIBase.cs @@ -93,6 +93,20 @@ namespace TEngine /// protected bool m_updateListValid = false; + private ComponentAutoBindTool _autoBindTool; + + protected ComponentAutoBindTool AutoBindTool + { + get + { + if (_autoBindTool == null && gameObject != null) + { + _autoBindTool = gameObject.GetComponent(); + } + return _autoBindTool; + } + } + /// /// 代码自动生成绑定。 /// @@ -243,7 +257,7 @@ namespace TEngine /// /// 创建UIWidget通过父UI位置节点。 - /// 因为资源示例已经存在父物体所以不需要异步。 + /// 因为资源实例已经存在父物体所以不需要异步。 /// /// 父UI位置节点。 /// 是否可见。 @@ -264,7 +278,7 @@ namespace TEngine /// /// 创建UIWidget通过父UI位置节点。 - /// 因为资源示例已经存在父物体所以不需要异步。 + /// 因为资源实例已经存在父物体所以不需要异步。 /// /// /// 父UI位置节点。 @@ -284,7 +298,7 @@ namespace TEngine /// /// 创建UIWidget通过游戏物体。 - /// 因为资源示例已经存在父物体所以不需要异步。 + /// 因为资源实例已经存在父物体所以不需要异步。 /// /// 游戏物体。 /// 是否可见。 @@ -456,7 +470,7 @@ namespace TEngine { if (prefab == null) { - tmpT = CreateWidgetByPath(parentTrans, assetPath); + tmpT = await CreateWidgetByPathAsync(parentTrans, assetPath); } else {