Merge branch 'AnHui_BaoShi' of http://git.zxkedu.com:33769/JiNan/VirtualFramework into AnHui_BaoShi

This commit is contained in:
李浩 2025-03-26 18:03:46 +08:00
commit e35012f096
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());
}
}
}