123456789101112131415161718192021222324252627282930313233343536373839404142 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using static Manager;
- public class GaoJingJiLu : UpdateManager
- {
- public GameObject gjtext;
- public JiLuItem item;
- public List<JiLuItem> items;
- public void setJILUData(GaoJingListData gj)
- {
- for (int i = 0; i < items.Count; i++)
- {
- Destroy(items[i].gameObject);
- }
- items = new List<JiLuItem>();
- for (int i = 0; i < gj.list.Count; i++)
- {
- JiLuItem go = GameObject.Instantiate(item,item.transform.parent);
- go.gameObject.SetActive(true);
- go.setData(gj.list[i]);
- items.Add(go);
- }
- if(gj.list.Count>0)
- {
- gjtext.SetActive(false);
- }
- else
- {
- gjtext.SetActive(true);
- }
- }
- public override void updateData()
- {
- base.updateData();
- DataManager.Instance.GetGaoJingJiLuData((data) => {
- setJILUData( data);
- });
- }
- }
|