Compare commits

...

2 Commits

Author SHA1 Message Date
shenjianxing
91b2e7f92e Merge branch 'master' into AnHui_BaoShi 2025-03-26 17:46:29 +08:00
shenjianxing
1a7e0af9a4 修复加载bug 2025-03-26 17:46:02 +08:00
2 changed files with 11 additions and 2 deletions

View File

@ -27,6 +27,7 @@ namespace QFramework.Example
protected override void OnOpen(IUIData uiData = null)
{
mData = uiData as UIBackPackData ?? new UIBackPackData();
Content.RemoveAllChildren();
foreach (var device in mData.devices)

View File

@ -17,7 +17,6 @@ namespace QFramework.Example
protected override void OnInit(IUIData uiData = null)
{
mData = uiData as UIOperationListData ?? new UIOperationListData();
TypeEventSystem.Global.Register<OnOperationChanged>((arg) => Refresh()).UnRegisterWhenGameObjectDestroyed(gameObject);
TypeEventSystem.Global.Register<OnModuleQuit>((arg) => Hide()).UnRegisterWhenGameObjectDestroyed(gameObject);
}
@ -81,8 +80,9 @@ namespace QFramework.Example
protected override void OnOpen(IUIData uiData = null)
{
TypeEventSystem.Global.Register<OnOperationChanged>((arg) => Refresh());
TypeEventSystem.Global.Register<StepStatusOnChange>(OnStepChanged).UnRegisterWhenDisabled(this);
Refresh();
}
public void Refresh()
@ -150,9 +150,17 @@ namespace QFramework.Example
protected override void OnShow()
{
Refresh();
}
protected override void OnClose()
{
TypeEventSystem.Global.UnRegister<OnOperationChanged>((arg) => Refresh());
}
public override void Hide()
{
base.Hide();
TypeEventSystem.Global.UnRegister<OnOperationChanged>((arg) => Refresh());
}
}
}