CustomPeerList.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class CustomPeerList : SCRtcPeers
  5. {
  6. public ItemList iList;
  7. public GameObject peerQuad;
  8. public override void removePeers(string pid)
  9. {
  10. CustomPeer p = (CustomPeer)getPeer(pid);
  11. if(p.isBig)
  12. {
  13. p.bigView.GetComponent<BigVideoManager>().closeRemove();
  14. }
  15. // getPeer(pid).Quad.GetComponent<MeshRenderer>().material.mainTexture = new Texture2D(640, 480, TextureFormat.RGB24, false);
  16. // GameObject.Destroy(getPeer(pid).Quad);
  17. base.removePeers(pid);
  18. //quadManager();
  19. iList.initList(this);
  20. }
  21. public override SCRtcPeer addPeers(string pid)
  22. {
  23. CustomPeer p = new CustomPeer();//实例了子类,这句话就是调用子类方法而不调用父类方法的原因
  24. p.peerId = pid;
  25. base.addPeers(p);
  26. // if (peerQuad!=null)
  27. // p.addQuad(peerQuad);
  28. //quadManager();
  29. iList.initList(this);
  30. return p;
  31. }
  32. public void quadManager()
  33. {
  34. }
  35. }