修复加载bug
This commit is contained in:
parent
60e6691027
commit
1a7e0af9a4
@ -27,6 +27,7 @@ namespace QFramework.Example
|
|||||||
|
|
||||||
protected override void OnOpen(IUIData uiData = null)
|
protected override void OnOpen(IUIData uiData = null)
|
||||||
{
|
{
|
||||||
|
mData = uiData as UIBackPackData ?? new UIBackPackData();
|
||||||
Content.RemoveAllChildren();
|
Content.RemoveAllChildren();
|
||||||
|
|
||||||
foreach (var device in mData.devices)
|
foreach (var device in mData.devices)
|
||||||
|
|||||||
@ -17,7 +17,6 @@ namespace QFramework.Example
|
|||||||
protected override void OnInit(IUIData uiData = null)
|
protected override void OnInit(IUIData uiData = null)
|
||||||
{
|
{
|
||||||
mData = uiData as UIOperationListData ?? new UIOperationListData();
|
mData = uiData as UIOperationListData ?? new UIOperationListData();
|
||||||
TypeEventSystem.Global.Register<OnOperationChanged>((arg) => Refresh()).UnRegisterWhenGameObjectDestroyed(gameObject);
|
|
||||||
TypeEventSystem.Global.Register<OnModuleQuit>((arg) => Hide()).UnRegisterWhenGameObjectDestroyed(gameObject);
|
TypeEventSystem.Global.Register<OnModuleQuit>((arg) => Hide()).UnRegisterWhenGameObjectDestroyed(gameObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -80,8 +79,9 @@ namespace QFramework.Example
|
|||||||
|
|
||||||
protected override void OnOpen(IUIData uiData = null)
|
protected override void OnOpen(IUIData uiData = null)
|
||||||
{
|
{
|
||||||
|
TypeEventSystem.Global.Register<OnOperationChanged>((arg) => Refresh());
|
||||||
TypeEventSystem.Global.Register<StepStatusOnChange>(OnStepChanged).UnRegisterWhenDisabled(this);
|
TypeEventSystem.Global.Register<StepStatusOnChange>(OnStepChanged).UnRegisterWhenDisabled(this);
|
||||||
Refresh();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Refresh()
|
public void Refresh()
|
||||||
@ -149,9 +149,17 @@ namespace QFramework.Example
|
|||||||
|
|
||||||
protected override void OnShow()
|
protected override void OnShow()
|
||||||
{
|
{
|
||||||
|
Refresh();
|
||||||
}
|
}
|
||||||
protected override void OnClose()
|
protected override void OnClose()
|
||||||
{
|
{
|
||||||
|
TypeEventSystem.Global.UnRegister<OnOperationChanged>((arg) => Refresh());
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Hide()
|
||||||
|
{
|
||||||
|
base.Hide();
|
||||||
|
TypeEventSystem.Global.UnRegister<OnOperationChanged>((arg) => Refresh());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user