From 36a54f3f1695e2ca4db6d1782f42057e3d044fa0 Mon Sep 17 00:00:00 2001 From: Tailor <45992829+526077247@users.noreply.github.com> Date: Sun, 18 Sep 2022 11:00:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9C=A8OnEnable=E4=B8=ADClo?= =?UTF-8?q?seSelf=E4=B8=8D=E7=94=9F=E6=95=88=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/Code/Module/UI/UIManager.cs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Assets/Scripts/Code/Module/UI/UIManager.cs b/Assets/Scripts/Code/Module/UI/UIManager.cs index b735071..0f06f60 100644 --- a/Assets/Scripts/Code/Module/UI/UIManager.cs +++ b/Assets/Scripts/Code/Module/UI/UIManager.cs @@ -574,13 +574,14 @@ async ETTask __InnerOpenWindow( UIWindow target) where T : UIBaseView target.Active = true; T res = target.View as T; var need_load = target.LoadingState == UIWindowLoadingState.NotStart; + target.LoadingState = UIWindowLoadingState.Loading; if (need_load) { - target.LoadingState = UIWindowLoadingState.Loading; await InnerOpenWindow_GetGameObject(target.PrefabPath,target); } InnerResetWindowLayer(target); await this.__AddWindowToStack(target); + target.LoadingState = UIWindowLoadingState.LoadOver; return res; } finally @@ -598,13 +599,14 @@ async ETTask __InnerOpenWindow( UIWindow target, P1 p1) where T : UIBa target.Active = true; T res = target.View as T; var need_load = target.LoadingState == UIWindowLoadingState.NotStart; + target.LoadingState = UIWindowLoadingState.Loading; if (need_load) { - target.LoadingState = UIWindowLoadingState.Loading; await InnerOpenWindow_GetGameObject(target.PrefabPath,target); } InnerResetWindowLayer(target); await this.__AddWindowToStack(target, p1); + target.LoadingState = UIWindowLoadingState.LoadOver; return res; } finally @@ -621,13 +623,14 @@ async ETTask __InnerOpenWindow( UIWindow target, P1 p1, P2 p2) whe target.Active = true; T res = target.View as T; var need_load = target.LoadingState == UIWindowLoadingState.NotStart; + target.LoadingState = UIWindowLoadingState.Loading; if (need_load) { - target.LoadingState = UIWindowLoadingState.Loading; await InnerOpenWindow_GetGameObject(target.PrefabPath,target); } InnerResetWindowLayer(target); await this.__AddWindowToStack(target, p1, p2); + target.LoadingState = UIWindowLoadingState.LoadOver; return res; } finally @@ -644,13 +647,14 @@ async ETTask __InnerOpenWindow( UIWindow target, P1 p1, P2 p2, target.Active = true; T res = target.View as T; var need_load = target.LoadingState == UIWindowLoadingState.NotStart; + target.LoadingState = UIWindowLoadingState.Loading; if (need_load) { - target.LoadingState = UIWindowLoadingState.Loading; await InnerOpenWindow_GetGameObject(target.PrefabPath,target); } InnerResetWindowLayer(target); await this.__AddWindowToStack(target, p1, p2, p3); + target.LoadingState = UIWindowLoadingState.LoadOver; return res; } finally @@ -667,13 +671,14 @@ async ETTask __InnerOpenWindow( UIWindow target, P1 p1, P2 target.Active = true; T res = target.View as T; var need_load = target.LoadingState == UIWindowLoadingState.NotStart; + target.LoadingState = UIWindowLoadingState.Loading; if (need_load) { - target.LoadingState = UIWindowLoadingState.Loading; await InnerOpenWindow_GetGameObject(target.PrefabPath,target); } InnerResetWindowLayer(target); await this.__AddWindowToStack(target, p1, p2, p3, p4); + target.LoadingState = UIWindowLoadingState.LoadOver; return res; } finally @@ -702,7 +707,6 @@ async ETTask InnerOpenWindow_GetGameObject(string path,UIWindow target) (view as IOnCreate)?.OnCreate(); if (view is II18N i18n) I18NManager.Instance.RegisterI18NEntity(i18n); - target.LoadingState = UIWindowLoadingState.LoadOver; } #endregion