12345678910111213141516171819202122232425262728 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class VIdeManager : UpdateManager
- {
- public ServerRoomVideoManager videoitem;
- List<ServerRoomVideoManager> list=new List<ServerRoomVideoManager>();
- 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<ServerRoomVideoManager>().setData(data.serverList[i].videolist, data.serverList[i].id);
- go.SetActive(true);
- list.Add(go.GetComponent<ServerRoomVideoManager>());
- }
- });
- }
- }
|