From d571a937f81936d3ade161dbb307565516cd266c Mon Sep 17 00:00:00 2001 From: ALEXTANGXIAO <574809918@qq.com> Date: Fri, 22 Nov 2024 23:09:44 +0800 Subject: [PATCH] =?UTF-8?q?UIWindow=E5=90=8C=E4=B8=80=E5=B8=A7=E5=85=B3?= =?UTF-8?q?=E9=97=AD=E5=AF=BC=E8=87=B4GameObject=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E9=94=80=E6=AF=81=E7=9A=84=E6=9E=81=E5=B0=8F=E6=A6=82=E7=8E=87?= =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Assets/TEngine/Runtime/Modules/UIModule/UIWindow.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/UnityProject/Assets/TEngine/Runtime/Modules/UIModule/UIWindow.cs b/UnityProject/Assets/TEngine/Runtime/Modules/UIModule/UIWindow.cs index a22f464d..fac24e8c 100644 --- a/UnityProject/Assets/TEngine/Runtime/Modules/UIModule/UIWindow.cs +++ b/UnityProject/Assets/TEngine/Runtime/Modules/UIModule/UIWindow.cs @@ -226,6 +226,7 @@ namespace TEngine /// internal bool IsLoadDone = false; + internal bool IsDestroyed = false; #endregion public void Init(string name, int layer, bool fullScreen, string assetName, bool fromResources, int hideTimeToClose) @@ -395,6 +396,8 @@ namespace TEngine _panel = null; } + IsDestroyed = true; + if (!isShutDown) { CancelHideToCloseTimer(); @@ -413,6 +416,12 @@ namespace TEngine } IsLoadDone = true; + + if (IsDestroyed) + { + Object.Destroy(panel); + return; + } panel.name = GetType().Name; _panel = panel;