CombatPuasePanel.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. namespace Fort23.Mono
  2. {
  3. [UIBinding(prefab = "CombatPuasePanel")]
  4. public partial class CombatPuasePanel : UIPanel
  5. {
  6. private System.Action<bool> callBack;
  7. public static async void OpenCombatPuasePanel(System.Action<bool> callBack)
  8. {
  9. CombatPuasePanel combatPuasePanel =
  10. await UIManager.Instance.LoadAndOpenPanel<CombatPuasePanel>(null, UILayer.Top, isFocus: true);
  11. combatPuasePanel.ShowUI(callBack);
  12. }
  13. public void ShowUI(System.Action<bool> callBack)
  14. {
  15. this.callBack = callBack;
  16. }
  17. private void Init()
  18. {
  19. }
  20. protected override void AddEvent()
  21. {
  22. }
  23. protected override void DelEvent()
  24. {
  25. }
  26. public override void AddButtonEvent()
  27. {
  28. JiXu.onClick.AddListener(() =>
  29. {
  30. UIManager.Instance.HideUIUIPanel(this);
  31. callBack.Invoke(false);
  32. });
  33. TuiChu.onClick.AddListener(() =>
  34. {
  35. UIManager.Instance.HideUIUIPanel(this);
  36. callBack.Invoke(true);
  37. });
  38. }
  39. }
  40. }