From 1f2d99ddc9741933178761e142ee0e8b0c7abc24 Mon Sep 17 00:00:00 2001 From: ALEXTANG <574809918@qq.com> Date: Fri, 8 Dec 2023 10:37:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3UIWindow=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E5=8F=A5=E6=9F=84=E6=97=B6=E5=BA=8F=E5=AF=BC=E8=87=B4UI?= =?UTF-8?q?=E5=90=8C=E6=AD=A5=E6=98=BE=E7=A4=BA=E5=A4=B1=E6=95=88=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Assets/TEngine/Runtime/Modules/UIModule/UIWindow.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/UnityProject/Assets/TEngine/Runtime/Modules/UIModule/UIWindow.cs b/UnityProject/Assets/TEngine/Runtime/Modules/UIModule/UIWindow.cs index 5e632ec9..df9f7f3b 100644 --- a/UnityProject/Assets/TEngine/Runtime/Modules/UIModule/UIWindow.cs +++ b/UnityProject/Assets/TEngine/Runtime/Modules/UIModule/UIWindow.cs @@ -255,7 +255,8 @@ namespace TEngine this.userDatas = userDatas; if (!FromResources) { - GameModule.Resource.LoadAssetAsync(location, Handle_Completed, needCache: NeedCache); + Handle = GameModule.Resource.LoadAssetAsyncHandle(location, needCache: NeedCache); + Handle.Completed += Handle_Completed; } else { @@ -394,13 +395,11 @@ namespace TEngine { throw new GameFrameworkException("Load uiWindows Failed because AssetObject is null"); } - Handle = handle; - // 实例化对象 var panel = handle.InstantiateSync(UIModule.UIRootStatic); if (!NeedCache) { - AssetReference.BindAssetReference(panel, handle, AssetName); + AssetReference.BindAssetReference(panel, Handle, AssetName); } Handle_Completed(panel); }