1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- 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<BattleSettlementPanel> OpenPanel(bool isWin, System.Action callBack)
- {
- BattleSettlementPanel battleSettlementPanel = await UIManager.Instance.LoadAndOpenPanel<BattleSettlementPanel>(null);
- battleSettlementPanel.CustomInit(isWin, callBack);
- return battleSettlementPanel;
- }
- }
- }
|