ShowUserMsg.cs 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using UnityEngine;
  5. using UnityEngine.UI;
  6. using XRTool.Util;
  7. public class ShowUserMsg : UnitySingleton<ShowUserMsg>
  8. {
  9. public GameObject AllUserView;
  10. public Button showAllUserViewBtn;
  11. public Text tName;
  12. public RawImage mViewTexture;
  13. public SysEnterManager sysEenter;
  14. public CustomPeer cPeer;
  15. // Start is called before the first frame update
  16. void Start()
  17. {
  18. showAllUserViewBtn.onClick.AddListener(OnClicKShowAllUser);
  19. }
  20. private void OnClicKShowAllUser()
  21. {
  22. AllUserView.SetActive(true);
  23. }
  24. public void Init(CustomPeer customPeer)
  25. {
  26. Debug.Log("InitTouxiang");
  27. sysEenter.gameObject.SetActive(true);
  28. cPeer = customPeer;
  29. sysEenter.cPeer = cPeer;
  30. tName.text = cPeer.name;
  31. AgoraVideoAudioManager.Instance.AddListShowView(cPeer.peerId, RoomMainForms.Instance.bigView);
  32. //cPeer.isAudio = true;
  33. //cPeer.isVideo = true;
  34. //if (!cPeer.isSn)
  35. //{
  36. // if (!string.IsNullOrEmpty(cPeer.avater))
  37. // {
  38. // NetWorkHeaders.Instance.getNetTexture(cPeer.avater, null, (Texture tex) =>
  39. // {
  40. // mViewTexture.texture = tex;
  41. // });
  42. // }
  43. // else
  44. // {
  45. // if (UserInfo.defaulttextIcon != null)
  46. // {
  47. // mViewTexture.texture = UserInfo.defaulttextIcon;
  48. // }
  49. // }
  50. //}
  51. //else
  52. //{
  53. // NetWorkHeaders.GetUserAvater((aData) =>
  54. // {
  55. // for (int j = 0; j < aData["data"]["sn"].Count; j++)
  56. // {
  57. // NetWorkHeaders.Instance.getNetTexture(aData["data"]["sn"][j].ToString(), null, (Texture tex) =>
  58. // {
  59. // mViewTexture.texture = tex;
  60. // });
  61. // }
  62. // });
  63. //}
  64. }
  65. }