ItemList.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using UnityEngine;
  7. public class ItemList : BaseList
  8. {
  9. public GameObject[] setting;
  10. List<BaseConfig> cList;
  11. public void initList(CustomPeerList cpl)
  12. {
  13. Dictionary<string, SCRtcPeer> sList = cpl.getPeers();
  14. // if(sList.Count>0)
  15. // {
  16. //List<BaseConfig> cList = new List<BaseConfig>();
  17. cList = new List<BaseConfig>();
  18. foreach (SCRtcPeer value in sList.Values)
  19. {
  20. CustomPeer cp = (CustomPeer)value;
  21. if(!cp.isBig)
  22. cList.Add(cp);
  23. }
  24. UpdateConfigs(cList);
  25. // }
  26. }
  27. public void AddList(CustomPeer customPeer)
  28. {
  29. if (!customPeer.isBig)
  30. cList.Add(customPeer);
  31. UpdateConfigs(cList);
  32. }
  33. public void RemoveList(CustomPeer customPeer)
  34. {
  35. if (!customPeer.isBig)
  36. cList.Remove(customPeer);
  37. UpdateConfigs(cList);
  38. }
  39. bool isShow=false;
  40. public void changeSetting()
  41. {
  42. for (int i = 0; i < setting.Length; i++)
  43. {
  44. setting[i].SetActive(!isShow);
  45. }
  46. isShow = !isShow;
  47. }
  48. }