CustomPeerList.cs 999 B

1234567891011121314151617181920212223242526272829303132333435
  1. using ShadowStudio.Mgr;
  2. using ShadowStudio.Model;
  3. using System.Collections;
  4. using System.Collections.Generic;
  5. using UnityEngine;
  6. public class CustomPeerList : SCRtcPeers
  7. {
  8. public GameObject peerQuad;
  9. public override void removePeers(string pid)
  10. {
  11. CustomPeer p = (CustomPeer)getPeer(pid);
  12. Debug.Log("删除=====》");
  13. if(UserItemList.Instance!=null&& UserItemList.Instance.PeerList!=null)
  14. {
  15. for (int i = 0; i < UserItemList.Instance.PeerList.Count; i++)
  16. {
  17. if (UserItemList.Instance.PeerList[i].PeerId == p.name)
  18. {
  19. UserItemList.Instance.DeleteUserItem(UserItemList.Instance.PeerList[i].PeerId);
  20. break;
  21. }
  22. }
  23. }
  24. base.removePeers(pid);
  25. }
  26. public override SCRtcPeer addPeers(string pid)
  27. {
  28. CustomPeer p = new CustomPeer();
  29. p.peerId = pid;
  30. base.addPeers(p);
  31. return p;
  32. }
  33. }