PlayerPassiveSkillIconListItemCtrl.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /// #pkgName FGUI包名
  2. /// #panelName UIPanel名字
  3. /// #UIName = $"{#pkgName}{#panelName}" UIKey名字
  4. /// 该脚本由模板创建
  5. /// created by cb 2024
  6. using FairyGUI;
  7. using System;
  8. using XGame.Database;
  9. using XGame.Framework.UI;
  10. namespace FL.FGUI
  11. {
  12. /// <summary>
  13. /// UI逻辑处理类
  14. /// </summary>
  15. /// <typeparam name=""></typeparam>
  16. public partial class PlayerPassiveSkillIconListItemCtrl : UIController<PlayerPassiveSkillIconListItemVM>
  17. {
  18. private int _index;
  19. private int _passiveSkillId;
  20. protected override void OnEnable(object intent)
  21. {
  22. AddUIListenres();
  23. }
  24. protected override void OnDisable()
  25. {
  26. RemoveUIListenres();
  27. _passiveSkillId = 0;
  28. }
  29. #region UI事件
  30. private void AddUIListenres()
  31. {
  32. }
  33. private void RemoveUIListenres()
  34. {
  35. }
  36. #endregion
  37. public void OnRefresh(int index, JobSkillParam data)
  38. {
  39. _index = index;
  40. _passiveSkillId = data.skillId;
  41. var skillInfo = SkillTableRepo.Get(data.skillId);
  42. if (skillInfo != null)
  43. {
  44. VM.SkillIcon.icon = skillInfo.Icon;
  45. }
  46. }
  47. }
  48. }