CustomPeer.cs 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using LitJson;
  4. using UnityEngine;
  5. using UnityEngine.UI;
  6. public class CustomPeer : SCRtcPeer
  7. {
  8. public bool isCloseAudio =false;
  9. private bool _isCloseVideo =false;
  10. public bool isCloseVideo { get { return _isCloseVideo; } set {
  11. _isCloseVideo = value;
  12. this.onChangeTexture();
  13. } }
  14. public GameObject bigView;
  15. public bool isShow;
  16. public int Index { get; set; }
  17. public GameObject Quad;
  18. public delegate void OnChangeTexture();
  19. public OnChangeTexture onChangeTexture;
  20. public delegate void OnChangeName(string n);
  21. public OnChangeName onChangeName;
  22. public delegate void OnChangeInfo(string type, string id);
  23. public OnChangeInfo onChangeInfo;
  24. public override void setInfo(string type, string id,bool isOpen)
  25. {
  26. base.setInfo(type, id, isOpen);
  27. if (onChangeInfo != null)
  28. {
  29. onChangeInfo(type, id);
  30. }
  31. }
  32. public override void setName(string n)
  33. {
  34. base.setName(n);
  35. if (onChangeName != null)
  36. {
  37. onChangeName(n);
  38. }
  39. }
  40. public void changeInfo(string info, CustomPeer customPeer)
  41. {
  42. if(customPeer.cIdA == info)
  43. {
  44. cIdA = "";
  45. }
  46. else
  47. {
  48. cIdV = "";
  49. //if (bigNameID == data["data"]["peerId"].ToString())
  50. //{
  51. // Debug.Log("PPT2");
  52. // bigMr.material.mainTexture = t2fang;
  53. //}
  54. //if (cp.isBig)
  55. //{
  56. // cp.bigView.GetComponent<BigVideoManager>().onChangeCloseInfo();
  57. //}
  58. }
  59. }
  60. public override void setTexture(JsonData data)
  61. {
  62. base.setTexture(data);
  63. showVideo(data);
  64. if (onChangeTexture != null)
  65. {
  66. onChangeTexture();
  67. }
  68. }
  69. public override void changeTexture(JsonData data)
  70. {
  71. base.changeTexture(data);
  72. changeVideo(data);
  73. }
  74. public void changeVideo(JsonData data)
  75. {
  76. }
  77. public void addQuad(GameObject peerQuad)
  78. {
  79. }
  80. public void showVideo(JsonData data)
  81. {
  82. }
  83. }