using System.Collections; using System.Collections.Generic; using UnityEngine; public class VIdeManager : UpdateManager { public ServerRoomVideoManager videoitem; List list=new List(); public override void updateData() { base.updateData(); DataManager.Instance.GetVideo((data)=> { for (int i = 0; i < list.Count; i++) { Destroy(list[i].gameObject); } for (int i = 0; i < 8; i++) { GameObject go = GameObject.Instantiate(videoitem.gameObject, videoitem.transform.parent); go.GetComponent().setData(data.serverList[i].videolist, data.serverList[i].id); go.SetActive(true); list.Add(go.GetComponent()); } }); } }