修改UI逻辑

This commit is contained in:
shenjianxing 2025-02-28 18:28:19 +08:00
parent 34fffe6daa
commit 32d905a8ea

View File

@ -13,6 +13,7 @@ namespace QFramework.Example
public partial class UIInstruction : UIPanel
{
bool isNo = false;
bool isOperation = false;
protected override void OnInit(IUIData uiData = null)
{
TypeEventSystem.Global.Register<OnModuleQuit>((arg) => Hide()).UnRegisterWhenGameObjectDestroyed(gameObject);
@ -46,8 +47,17 @@ namespace QFramework.Example
});
ConfirmBtn.onClick.AddListener(() =>
{
Hide();
isNo = NoToggle.isOn;
if (isOperation == false)
{
Operation.isOn = true;
isOperation = true;
}
else
{
Hide();
isNo = NoToggle.isOn;
}
});