TowerPanel.cs 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. using System.Collections.Generic;
  2. using System.Linq;
  3. using Excel2Json;
  4. using Fort23.Core;
  5. using Fort23.UTool;
  6. using GameLogic.Combat.CombatTool;
  7. using UnityEngine;
  8. namespace Fort23.Mono
  9. {
  10. [UIBinding(prefab = "TowerPanel")]
  11. public partial class TowerPanel : UIPanel, IScrollListContent
  12. {
  13. List<TowerInfoConfig> towerInfoConfigps;
  14. private void Init()
  15. {
  16. }
  17. protected override void AddEvent()
  18. {
  19. }
  20. protected override void DelEvent()
  21. {
  22. }
  23. public override void AddButtonEvent()
  24. {
  25. }
  26. public override CTask<bool> AsyncInit(object[] uiData)
  27. {
  28. int towerId = (int)uiData[0];
  29. TowerConfig towerConfig = ConfigComponent.Instance.Get<TowerConfig>(towerId);
  30. var configs = ConfigComponent.Instance.GetAll<TowerInfoConfig>();
  31. towerInfoConfigps = configs.Where(t => t.groupId == towerConfig.towerinfoIdGroup).ToList();
  32. return base.AsyncInit(uiData);
  33. }
  34. public static async CTask OpenPanel()
  35. {
  36. TowerPanel towerPanel = await UIManager.Instance.LoadAndOpenPanel<TowerPanel>(null);
  37. }
  38. public CTask<IScorllListWidget> GetIScorllListWidget(int index, RectTransform root)
  39. {
  40. int currInsex = index;
  41. if (currInsex < 0 || currInsex >= towerInfoConfigps.Count)
  42. {
  43. return null;
  44. }
  45. // BigSecretAreaWidget woc1 =
  46. // await UIManager.Instance.CreateGComponent<BigSecretAreaWidget>(null, ContentRoot);
  47. // woc1.CustomInit(bigSecretRealmBattleConfigs[currInsex], Onclick);
  48. return null;
  49. }
  50. public void HindIScorllListWidget(IScorllListWidget widget)
  51. {
  52. UIManager.Instance.DormancyGComponent(widget as UIComponent);
  53. }
  54. }
  55. }