123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- using ShadowStudio.Mgr;
- using ShadowStudio.Model;
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class CustomPeerList : SCRtcPeers
- {
- public GameObject peerQuad;
- public override void removePeers(string pid)
- {
- CustomPeer p = (CustomPeer)getPeer(pid);
- if(PopPeerView.Instance)
- {
- for (int j = 0; j < PopPeerView.Instance.bigList.Count; j++)
- {
- if (PopPeerView.Instance.bigList[j].cPeer.peerId == pid)
- {
- PopPeerView.Instance.bigList[j].closeView();
- }
- }
- }
- if(RoomMain.Instance.userId == pid)
- {
- bool isBigShow=false;
- foreach (CustomPeer peer in getPeers().Values)
- {
- if (!peer.isShow&& pid!=peer.peerId)
- {
- isBigShow = true;
- RoomMain.Instance.setBigView(peer.tex, peer.peerId);
- }
- }
- if(!isBigShow)
- {
- RoomMain.Instance.setBigView(RemoteRtc.Instance.NoUser,"nouser");
- }
- }
- Debug.Log("删除=====》");
- if(UserItemList.Instance!=null&& UserItemList.Instance.PeerList!=null)
- {
- for (int i = 0; i < UserItemList.Instance.PeerList.Count; i++)
- {
- if (UserItemList.Instance.PeerList[i].PeerId == p.name)
- {
- UserItemList.Instance.DeleteUserItem(UserItemList.Instance.PeerList[i].PeerId);
- break;
- }
- }
- }
- base.removePeers(pid);
- }
- public override SCRtcPeer addPeers(string pid)
- {
- CustomPeer p = new CustomPeer();
- p.peerId = pid;
- base.addPeers(p);
- return p;
- }
- }
|