BattleMapBattleMapTestCtrl.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /// #pkgName FGUI包名
  2. /// #panelName UIPanel名字
  3. /// #UIName = $"{#pkgName}{#panelName}" UIKey名字
  4. /// 该脚本由模板创建
  5. /// created by cb 2024
  6. using FairyGUI;
  7. using XGame.Framework.UI;
  8. namespace FL.FGUI
  9. {
  10. /// <summary>
  11. /// UI逻辑处理类
  12. /// </summary>
  13. /// <typeparam name=""></typeparam>
  14. public partial class BattleMapBattleMapTestCtrl : UIController<BattleMapBattleMapTestVM>
  15. {
  16. protected override void OnEnable(object intent)
  17. {
  18. VM.BattleList.ListType = EGListType.VirtualAndLoop;
  19. RefreshList();
  20. AddUIListenres();
  21. }
  22. protected override void OnDisable()
  23. {
  24. RemoveUIListenres();
  25. }
  26. #region UI事件
  27. private void AddUIListenres()
  28. {
  29. }
  30. private void RemoveUIListenres()
  31. {
  32. }
  33. #endregion
  34. private void RefreshList()
  35. {
  36. var datas = new MainListShopItemData[6];
  37. for (int i = 0; i < datas.Length; i++)
  38. {
  39. datas[i] = new MainListShopItemData()
  40. {
  41. id = i * 1000,
  42. name = "name" + i,
  43. };
  44. }
  45. VM.BattleList.BindDatas(datas);
  46. }
  47. }
  48. }