using Fort23.Core; namespace Fort23.Mono { [UIBinding(prefab = "CheckBoxPanel")] public partial class CheckBoxPanel : UIPanel { private CTask cTask; private bool isok = false; private void Init() { } protected override void AddEvent() { } protected override void DelEvent() { } public override void AddButtonEvent() { Btn_Baochun.onClick.AddListener(() => { if (InputField_Name.text == "确认删除") { isok = true; UIManager.Instance.HideUIUIPanel(this); } }); } public void CustomInit(CTask cTask) { isok = false; this.cTask = cTask; } public override CTask Close() { cTask.SetResult(isok); return base.Close(); } public async CTask OpenPanel() { CTask cTask = CTask.Create(); CheckBoxPanel checkBoxPanel = await UIManager.Instance.LoadAndOpenPanel(null, UILayer.Top, isShowBG: true); checkBoxPanel.CustomInit(cTask); return await cTask; } } }