Skip to content

Commit

Permalink
修复在OnEnable中CloseSelf不生效的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
526077247 committed Sep 18, 2022
1 parent 12461e9 commit 36a54f3
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions Assets/Scripts/Code/Module/UI/UIManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -574,13 +574,14 @@ async ETTask<T> __InnerOpenWindow<T>( 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
Expand All @@ -598,13 +599,14 @@ async ETTask<T> __InnerOpenWindow<T, P1>( 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
Expand All @@ -621,13 +623,14 @@ async ETTask<T> __InnerOpenWindow<T, P1, P2>( 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
Expand All @@ -644,13 +647,14 @@ async ETTask<T> __InnerOpenWindow<T, P1, P2, P3>( 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
Expand All @@ -667,13 +671,14 @@ async ETTask<T> __InnerOpenWindow<T, P1, P2, P3, P4>( 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
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 36a54f3

Please sign in to comment.