修改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 public partial class UIInstruction : UIPanel
{ {
bool isNo = false; bool isNo = false;
bool isOperation = false;
protected override void OnInit(IUIData uiData = null) protected override void OnInit(IUIData uiData = null)
{ {
TypeEventSystem.Global.Register<OnModuleQuit>((arg) => Hide()).UnRegisterWhenGameObjectDestroyed(gameObject); TypeEventSystem.Global.Register<OnModuleQuit>((arg) => Hide()).UnRegisterWhenGameObjectDestroyed(gameObject);
@ -45,9 +46,18 @@ namespace QFramework.Example
OperationContent.gameObject.SetActive(isOn); OperationContent.gameObject.SetActive(isOn);
}); });
ConfirmBtn.onClick.AddListener(() => ConfirmBtn.onClick.AddListener(() =>
{
if (isOperation == false)
{
Operation.isOn = true;
isOperation = true;
}
else
{ {
Hide(); Hide();
isNo = NoToggle.isOn; isNo = NoToggle.isOn;
}
}); });