CustomPeer.cs 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using LitJson;
  4. using UnityEngine;
  5. using UnityEngine.UI;
  6. public class CustomPeer : SCRtcPeer, BaseConfig
  7. {
  8. public bool isVideo=true;
  9. public bool isAudio=true;
  10. public GameObject bigView;
  11. public bool isBig;
  12. public int Index { get; set; }
  13. public GameObject Quad;
  14. public delegate void OnChangeTexture();
  15. public OnChangeTexture onChangeTexture;
  16. public delegate void OnChangeName(string n);
  17. public OnChangeName onChangeName;
  18. public delegate void OnChangeInfo(string type, string id);
  19. public OnChangeInfo onChangeInfo;
  20. public override void setInfo(string type, string id)
  21. {
  22. base.setInfo(type, id);
  23. if (onChangeInfo != null)
  24. {
  25. onChangeInfo(type, id);
  26. }
  27. }
  28. public override void setName(string n)
  29. {
  30. Debug.Log("setNamesetNamesetNamesetName");
  31. base.setName(n);
  32. if (onChangeName != null)
  33. {
  34. onChangeName(n);
  35. }
  36. }
  37. public void changeInfo(string info)
  38. {
  39. if(cIdA==info)
  40. {
  41. cIdA = "";
  42. }
  43. else
  44. {
  45. cIdV = "";
  46. }
  47. }
  48. public override void setTexture(JsonData data)
  49. {
  50. base.setTexture(data);
  51. showVideo(data);
  52. if (onChangeTexture != null)
  53. {
  54. onChangeTexture();
  55. }
  56. }
  57. public override void changeTexture(JsonData data)
  58. {
  59. base.changeTexture(data);
  60. changeVideo(data);
  61. }
  62. public void changeVideo(JsonData data)
  63. {
  64. }
  65. public void addQuad(GameObject peerQuad)
  66. {
  67. }
  68. public void showVideo(JsonData data)
  69. {
  70. }
  71. public void OnClick()
  72. {
  73. }
  74. public void OnEnter()
  75. {
  76. }
  77. public void OnExit()
  78. {
  79. }
  80. public void OnDown()
  81. {
  82. }
  83. public void OnUp()
  84. {
  85. }
  86. public void Start()
  87. {
  88. }
  89. public void Awake()
  90. {
  91. }
  92. public void Update()
  93. {
  94. }
  95. public void OnDestroy()
  96. {
  97. }
  98. public void Init()
  99. {
  100. }
  101. }