12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- 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()
- {
- Btn_Close.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)
- {
- WinRoot.SetActive(true);
- FailRoot.SetActive(false);
- // f
- // Text_Desc.gameObject.SetActive(false);
- // Text_Settlement.text = "胜利";
- }
- else
- {
- WinRoot.SetActive(false);
- FailRoot.SetActive(true);
- // 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;
- }
- }
- }
|