PartnerStarBuffItemCtrl.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /// #pkgName FGUI包名
  2. /// #panelName UIPanel名字
  3. /// #UIName = $"{#pkgName}{#panelName}" UIKey名字
  4. /// 该脚本由模板创建
  5. /// created by cb 2024
  6. using FairyGUI;
  7. using FL.Data;
  8. using System.Collections.Generic;
  9. using XGame.Database;
  10. using XGame.Framework.UI;
  11. namespace FL.FGUI
  12. {
  13. /// <summary>
  14. /// UI逻辑处理类
  15. /// </summary>
  16. /// <typeparam name=""></typeparam>
  17. public partial class PartnerStarBuffItemCtrl : UIController<PartnerStarBuffItemVM>
  18. {
  19. protected override void OnEnable(object intent)
  20. {
  21. AddUIListenres();
  22. }
  23. protected override void OnDisable()
  24. {
  25. RemoveUIListenres();
  26. }
  27. #region UI事件
  28. private void AddUIListenres()
  29. {
  30. }
  31. private void RemoveUIListenres()
  32. {
  33. }
  34. #endregion
  35. public void OnRefresh(int index, List<int> paramList)
  36. {
  37. ShowUI(paramList[0], paramList[1], paramList[2]);
  38. }
  39. public void ShowUI(int skillId, int needStarLevel, int curStarLv)
  40. {
  41. ShowSkillDesc(skillId);
  42. VM.LockCtrl.selectedIndex = (needStarLevel > curStarLv) ? 0 : 1;
  43. ShowStarIcon(needStarLevel);
  44. }
  45. private void ShowSkillDesc(int skillId)
  46. {
  47. var skillInfo = SkillTableRepo.Get(skillId);
  48. VM.BuffLabel.text = skillInfo == null ? "" : skillInfo.Desc;
  49. }
  50. private void ShowStarIcon(int needStarLevel)
  51. {
  52. VM.StarItem.Ctrl.ShowStarUI(needStarLevel);
  53. }
  54. }
  55. }