GaoJingJiLu.cs 846 B

1234567891011121314151617181920212223242526272829303132
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using static Manager;
  5. public class GaoJingJiLu : UpdateManager
  6. {
  7. public JiLuItem item;
  8. public List<JiLuItem> items;
  9. public void setJILUData(GaoJingListData gj)
  10. {
  11. for (int i = 0; i < items.Count; i++)
  12. {
  13. Destroy(items[i].gameObject);
  14. }
  15. items = new List<JiLuItem>();
  16. for (int i = 0; i < gj.list.Count; i++)
  17. {
  18. JiLuItem go = GameObject.Instantiate(item,item.transform.parent);
  19. go.gameObject.SetActive(true);
  20. go.setData(gj.list[i]);
  21. items.Add(go);
  22. }
  23. }
  24. public override void updateData()
  25. {
  26. base.updateData();
  27. DataManager.Instance.GetGaoJingJiLuData((data) => {
  28. setJILUData( data);
  29. });
  30. }
  31. }