PartnerSbUpListItemCtrl.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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 XGame.Framework.UI;
  9. namespace FL.FGUI
  10. {
  11. /// <summary>
  12. /// UI逻辑处理类
  13. /// </summary>
  14. /// <typeparam name=""></typeparam>
  15. public partial class PartnerSbUpListItemCtrl : UIController<PartnerSbUpListItemVM>
  16. {
  17. protected override void OnEnable(object intent)
  18. {
  19. AddUIListenres();
  20. }
  21. protected override void OnDisable()
  22. {
  23. RemoveUIListenres();
  24. }
  25. #region UI事件
  26. private void AddUIListenres()
  27. {
  28. }
  29. private void RemoveUIListenres()
  30. {
  31. }
  32. #endregion
  33. #region 属性
  34. private int _slotId;
  35. private int _sbId;
  36. #endregion
  37. public void OnRefresh(int index, PartnerSbUpListItemParam param)
  38. {
  39. _slotId = param.PosId;
  40. var slotData = PartnersData.Instance.CurUsePlan.GetSlot(_slotId);
  41. _sbId = slotData?.SbId ?? 0;
  42. VM.IsSelect.selectedIndex = param.PosId == param.CurSelectPos ? 0 : 1;
  43. VM.SbItem.Ctrl.ShowUI(_sbId);
  44. }
  45. }
  46. }