1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
-
- using SC.XR.Unity;
- using System;
- using System.Collections.Generic;
- using static ScenesManager;
- public class RoomOtherUser : RemoteSingleton<RoomOtherUser>
- {
- public static Action<string> ShowAction;
- public NormalList Nlist;
- private void Start()
- {
- // UpdateList();
- }
- public override void initShow()
- {
- base.initShow();
- UpdateList();
- }
- private List<string> vs = new List<string>();
- public void UpdateList()
- {
- if (vs.Count > 0)
- {
- vs.Clear();
- }
- List<BaseConfig> list = new List<BaseConfig>();
- CustomPeerList peerlist = RemoteRtc.Instance.customPeerList;
- PeerConfig pconfig;
- for (int i = 0; i < peerlist.getPaiXuPeers().Count; i++)
- {
- CustomPeer peer = (CustomPeer)peerlist.getPeer(peerlist.getPaiXuPeers()[i]);
- if (!peer.isShow)
- {
- pconfig = new PeerConfig();
- pconfig.name = peer.name;
- pconfig.peer = peer;
- list.Add(pconfig);
- vs.Add(pconfig.peer.peerId);
- }
- }
- if (InviteDlg.Instance && InviteDlg.Instance.InvitingUnionIdList.Count > 0)
- {
- for (int i = InviteDlg.Instance.InvitingUnionIdList.Count - 1; i >= 0; i--)
- {
- if (vs.Contains(InviteDlg.Instance.InvitingUnionIdList[i].UnionId))
- {
- InviteDlg.Instance.InvitingUnionIdList.Remove(InviteDlg.Instance.InvitingUnionIdList[i]);
- }
- }
- for (int i = 0; i < InviteDlg.Instance.InvitingUnionIdList.Count; i++)
- {
- list.Add(InviteDlg.Instance.InvitingUnionIdList[i]);
- }
- if (peerlist.getPeers().Count + InviteDlg.Instance.InvitingUnionIdList.Count < RoomMainInfo.roomMaxPeopleNum - 1)
- {
- BaseConfig baseConfig = new BaseConfig();
- list.Add(baseConfig);
- }
- }
- else
- {
- if (peerlist.getPeers().Count < RoomMainInfo.roomMaxPeopleNum - 1 && RoomMainInfo.isCreator == "0")
- {
- BaseConfig baseConfig = new BaseConfig();
- list.Add(baseConfig);
- }
- }
- Nlist.initList(list);
- list.Clear();
- vs.Clear();
- }
- }
|