RoomOtherUser.cs 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. using SC.XR.Unity;
  2. using System;
  3. using System.Collections.Generic;
  4. using static ScenesManager;
  5. public class RoomOtherUser : RemoteSingleton<RoomOtherUser>
  6. {
  7. public static Action<string> ShowAction;
  8. public NormalList Nlist;
  9. private void Start()
  10. {
  11. // UpdateList();
  12. }
  13. public override void initShow()
  14. {
  15. base.initShow();
  16. UpdateList();
  17. }
  18. private List<string> vs = new List<string>();
  19. public void UpdateList()
  20. {
  21. if (vs.Count > 0)
  22. {
  23. vs.Clear();
  24. }
  25. List<BaseConfig> list = new List<BaseConfig>();
  26. //CustomPeerList peerlist = RemoteRtc.Instance.customPeerList;
  27. //PeerConfig pconfig;
  28. //for (int i = 0; i < peerlist.getPaiXuPeers().Count; i++)
  29. //{
  30. // CustomPeer peer = (CustomPeer)peerlist.getPeer(peerlist.getPaiXuPeers()[i]);
  31. // if (!peer.isShow)
  32. // {
  33. // pconfig = new PeerConfig();
  34. // pconfig.name = peer.name;
  35. // pconfig.peer = peer;
  36. // list.Add(pconfig);
  37. // vs.Add(pconfig.peer.peerId);
  38. // }
  39. //}
  40. if (InviteDlg.Instance && InviteDlg.Instance.InvitingUnionIdList.Count > 0)
  41. {
  42. for (int i = InviteDlg.Instance.InvitingUnionIdList.Count - 1; i >= 0; i--)
  43. {
  44. if (vs.Contains(InviteDlg.Instance.InvitingUnionIdList[i].UnionId))
  45. {
  46. InviteDlg.Instance.InvitingUnionIdList.Remove(InviteDlg.Instance.InvitingUnionIdList[i]);
  47. }
  48. }
  49. for (int i = 0; i < InviteDlg.Instance.InvitingUnionIdList.Count; i++)
  50. {
  51. list.Add(InviteDlg.Instance.InvitingUnionIdList[i]);
  52. }
  53. //if (peerlist.getPeers().Count + InviteDlg.Instance.InvitingUnionIdList.Count < RoomMainInfo.roomMaxPeopleNum - 1)
  54. //{
  55. // BaseConfig baseConfig = new BaseConfig();
  56. // list.Add(baseConfig);
  57. //}
  58. }
  59. else
  60. {
  61. //if (peerlist.getPeers().Count < RoomMainInfo.roomMaxPeopleNum - 1 && RoomMainInfo.isCreator == "0")
  62. //{
  63. // BaseConfig baseConfig = new BaseConfig();
  64. // list.Add(baseConfig);
  65. //}
  66. }
  67. Nlist.initList(list);
  68. list.Clear();
  69. vs.Clear();
  70. }
  71. }