CustomPeer.cs 2.3 KB

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