HeroBreakthroughFailPanel.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. using Core.Language;
  2. using Fort23.Core;
  3. namespace Fort23.Mono
  4. {
  5. [UIBinding(prefab = "HeroBreakthroughFailPanel")]
  6. public partial class HeroBreakthroughFailPanel : UIPanel
  7. {
  8. private void Init()
  9. {
  10. }
  11. protected override void AddEvent()
  12. {
  13. }
  14. protected override void DelEvent()
  15. {
  16. }
  17. public override void AddButtonEvent()
  18. {
  19. Btn_Close.onClick.AddListener(() => { UIManager.Instance.HideUIUIPanel(this); });
  20. }
  21. public void CustomInit(int type, int xw)
  22. {
  23. if (type == 2)
  24. {
  25. Icon_Tu.gameObject.SetActive(true);
  26. Icon_Dj.gameObject.SetActive(false);
  27. }
  28. else if (type == 3)
  29. {
  30. Icon_Tu.gameObject.SetActive(false);
  31. Icon_Dj.gameObject.SetActive(true);
  32. }
  33. // //扣除失败后的经验
  34. // float failbl = xw == 0
  35. // ? PlayerManager.Instance.myHero.powerUpConfig.FailureExpReduce
  36. // : (float)(PlayerManager.Instance.myHero.powerUpConfig.FailureExpReduce * xw * 0.01f);
  37. // int failXw = (int)(PlayerManager.Instance.myHero.powerUpConfig.levelUpExp * failbl * 0.01f);
  38. Text_Xw.text = LanguageManager.Instance.Text(10792, xw);
  39. }
  40. public static async CTask<HeroBreakthroughFailPanel> OpenPanel(int type, int xw)
  41. {
  42. HeroBreakthroughFailPanel heroBreakthroughFailPanel =
  43. await UIManager.Instance.LoadAndOpenPanel<HeroBreakthroughFailPanel>(null, UILayer.Top, isShowBG: true);
  44. heroBreakthroughFailPanel.CustomInit(type, xw);
  45. return heroBreakthroughFailPanel;
  46. }
  47. }
  48. }