using Fort23.Core; namespace Fort23.Mono { [UIBinding(prefab = "BattleSettlementPanel")] public partial class BattleSettlementPanel : UIPanel { private System.Action callBack; private void Init() { isAddStack = false; } protected override void AddEvent() { } protected override void DelEvent() { } public override void AddButtonEvent() { Button_ok.onClick.AddListener(async () => { await UIManager.Instance.HideUIUIPanel(this); callBack?.Invoke(); callBack = null; }); } public void CustomInit(bool isWin, System.Action callBack) { this.callBack = callBack; if (isWin) { Text_Desc.gameObject.SetActive(false); Text_Settlement.text = "胜利"; } else { Text_Desc.gameObject.SetActive(true); Text_Settlement.text = "失败"; } } public static async CTask OpenPanel(bool isWin, System.Action callBack) { BattleSettlementPanel battleSettlementPanel = await UIManager.Instance.LoadAndOpenPanel(null); battleSettlementPanel.CustomInit(isWin, callBack); return battleSettlementPanel; } } }