修改UI逻辑
This commit is contained in:
parent
e7a6837c40
commit
d679f7f50d
@ -18,26 +18,7 @@ namespace QFramework.Example
|
|||||||
TypeEventSystem.Global.Register<OnModuleQuit>(OnModuleQuitEvent);
|
TypeEventSystem.Global.Register<OnModuleQuit>(OnModuleQuitEvent);
|
||||||
|
|
||||||
// please add init code here
|
// please add init code here
|
||||||
BS.GetComponent<Toggle>().onValueChanged.AddListener((isOn) =>
|
|
||||||
{
|
|
||||||
SelectBaoShi(BS.transform.name);
|
|
||||||
});
|
|
||||||
ZML.GetComponent<Toggle>().onValueChanged.AddListener((isOn) =>
|
|
||||||
{
|
|
||||||
SelectBaoShi(ZML.transform.name);
|
|
||||||
});
|
|
||||||
HBS.GetComponent<Toggle>().onValueChanged.AddListener((isOn) =>
|
|
||||||
{
|
|
||||||
SelectBaoShi(HBS.transform.name);
|
|
||||||
});
|
|
||||||
HSJJS.GetComponent<Toggle>().onValueChanged.AddListener((isOn) =>
|
|
||||||
{
|
|
||||||
SelectBaoShi(HSJJS.transform.name);
|
|
||||||
});
|
|
||||||
LBS.GetComponent<Toggle>().onValueChanged.AddListener((isOn) =>
|
|
||||||
{
|
|
||||||
SelectBaoShi(LBS.transform.name);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnModuleQuitEvent(OnModuleQuit quit)
|
private void OnModuleQuitEvent(OnModuleQuit quit)
|
||||||
@ -59,13 +40,39 @@ namespace QFramework.Example
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnShow()
|
protected override void OnShow()
|
||||||
{
|
{
|
||||||
BS.GetComponent<Toggle>().isOn = false;
|
BS.onValueChanged.RemoveAllListeners();
|
||||||
|
ZML.onValueChanged.RemoveAllListeners();
|
||||||
|
HBS.onValueChanged.RemoveAllListeners();
|
||||||
|
HSJJS.onValueChanged.RemoveAllListeners();
|
||||||
|
LBS.onValueChanged.RemoveAllListeners();
|
||||||
|
|
||||||
|
BS.GetComponent<Toggle>().isOn = false;
|
||||||
ZML.GetComponent<Toggle>().isOn = false;
|
ZML.GetComponent<Toggle>().isOn = false;
|
||||||
HBS.GetComponent<Toggle>().isOn = false;
|
HBS.GetComponent<Toggle>().isOn = false;
|
||||||
HSJJS.GetComponent<Toggle>().isOn = false;
|
HSJJS.GetComponent<Toggle>().isOn = false;
|
||||||
LBS.GetComponent<Toggle>().isOn = false;
|
LBS.GetComponent<Toggle>().isOn = false;
|
||||||
}
|
BS.GetComponent<Toggle>().onValueChanged.AddListener((isOn) =>
|
||||||
|
{
|
||||||
|
SelectBaoShi(BS.transform.name);
|
||||||
|
});
|
||||||
|
ZML.GetComponent<Toggle>().onValueChanged.AddListener((isOn) =>
|
||||||
|
{
|
||||||
|
SelectBaoShi(ZML.transform.name);
|
||||||
|
});
|
||||||
|
HBS.GetComponent<Toggle>().onValueChanged.AddListener((isOn) =>
|
||||||
|
{
|
||||||
|
SelectBaoShi(HBS.transform.name);
|
||||||
|
});
|
||||||
|
HSJJS.GetComponent<Toggle>().onValueChanged.AddListener((isOn) =>
|
||||||
|
{
|
||||||
|
SelectBaoShi(HSJJS.transform.name);
|
||||||
|
});
|
||||||
|
LBS.GetComponent<Toggle>().onValueChanged.AddListener((isOn) =>
|
||||||
|
{
|
||||||
|
SelectBaoShi(LBS.transform.name);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
protected override void OnHide()
|
protected override void OnHide()
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user