VideoManager.cs 905 B

12345678910111213141516171819202122232425262728
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class VIdeManager : UpdateManager
  5. {
  6. public ServerRoomVideoManager videoitem;
  7. List<ServerRoomVideoManager> list=new List<ServerRoomVideoManager>();
  8. public override void updateData()
  9. {
  10. base.updateData();
  11. DataManager.Instance.GetVideo((data)=> {
  12. for (int i = 0; i < list.Count; i++)
  13. {
  14. Destroy(list[i].gameObject);
  15. }
  16. for (int i = 0; i < 8; i++)
  17. {
  18. GameObject go = GameObject.Instantiate(videoitem.gameObject, videoitem.transform.parent);
  19. go.GetComponent<ServerRoomVideoManager>().setData(data.serverList[i].videolist, data.serverList[i].id);
  20. go.SetActive(true);
  21. list.Add(go.GetComponent<ServerRoomVideoManager>());
  22. }
  23. });
  24. }
  25. }