SysEnterManager.cs 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using XRTool.Util;
  5. public class SysEnterManager : MonoBehaviour
  6. {
  7. public CustomPeer cPeer;
  8. private GameObject pAbe { get { return UnityUtil.GetDepthChild<Transform>(transform, "AudioBtnPause").gameObject; } }
  9. private GameObject oAbe { get { return UnityUtil.GetDepthChild<Transform>(transform, "AudioBtnOpen").gameObject; } }
  10. private GameObject cAbe { get { return UnityUtil.GetDepthChild<Transform>(transform, "AudioBtnClose").gameObject; } }
  11. private GameObject pVbe { get { return UnityUtil.GetDepthChild<Transform>(transform, "VideoBtnPause").gameObject; } }
  12. private GameObject oVbe { get { return UnityUtil.GetDepthChild<Transform>(transform, "VideoBtnOpen").gameObject; } }
  13. private GameObject cVbe { get { return UnityUtil.GetDepthChild<Transform>(transform, "VideoBtnClose").gameObject; } }
  14. private void Update()
  15. {
  16. checkPeer();
  17. }
  18. void checkPeer()
  19. {
  20. if (cPeer != null)
  21. {
  22. if (cPeer.isAudio)
  23. {
  24. if (!cPeer.isCloseAudio)
  25. {
  26. pAbe.SetActive(false);
  27. oAbe.SetActive(false);
  28. cAbe.SetActive(true);
  29. }
  30. else
  31. {
  32. pAbe.SetActive(true);
  33. oAbe.SetActive(false);
  34. cAbe.SetActive(false);
  35. }
  36. }
  37. else
  38. {
  39. pAbe.SetActive(false);
  40. oAbe.SetActive(true);
  41. cAbe.SetActive(false);
  42. }
  43. if (cPeer.isVideo)
  44. {
  45. if (!cPeer.isCloseVideo)
  46. {
  47. pVbe.SetActive(false);
  48. oVbe.SetActive(false);
  49. cVbe.SetActive(true);
  50. }
  51. else
  52. {
  53. pVbe.SetActive(true);
  54. oVbe.SetActive(false);
  55. cVbe.SetActive(false);
  56. }
  57. }
  58. else
  59. {
  60. pVbe.SetActive(false);
  61. oVbe.SetActive(true);
  62. cVbe.SetActive(false);
  63. }
  64. }
  65. }
  66. }