RemoteSystem.cs 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. using Newtonsoft.Json;
  2. using SC.XR.Unity;
  3. using System.Collections.Generic;
  4. using UnityEngine;
  5. using static ScenesManager;
  6. public class RemoteSystem : RemoteSingleton<RemoteSystem>
  7. {
  8. public GameObject audioOpen;
  9. public GameObject audioClose;
  10. public GameObject videoOpen;
  11. public GameObject videoClose;
  12. public NormalList sysList;
  13. public override void initShow()
  14. {
  15. base.initShow();
  16. sysList.initList(CustomInfo.sscList);
  17. audioOpen.SetActive(!CustomInfo.isSendAudio);
  18. audioClose.SetActive(CustomInfo.isSendAudio);
  19. videoOpen.SetActive(!CustomInfo.isSendVideo);
  20. videoClose.SetActive(CustomInfo.isSendVideo);
  21. }
  22. public void showOffice()
  23. {
  24. NetWorkHeaders.SetUserSys(CustomInfo.isSendAudio, CustomInfo.isSendVideo, CustomInfo.camIndex);
  25. ScenesManager.Instance.showOffice(SceneType.OfficeWindow);
  26. }
  27. public void audioChoose()
  28. {
  29. CustomInfo.isSendAudio = !CustomInfo.isSendAudio;
  30. audioOpen.SetActive(!CustomInfo.isSendAudio);
  31. audioClose.SetActive(CustomInfo.isSendAudio);
  32. SystemDatas data = new SystemDatas();
  33. data.Camera = CustomInfo.isSendVideo ? 1 : 0;
  34. data.Mic = CustomInfo.isSendAudio ? 1 : 0;
  35. SaveSystemData(data);
  36. }
  37. public void videoChoose()
  38. {
  39. CustomInfo.isSendVideo = !CustomInfo.isSendVideo;
  40. videoOpen.SetActive(!CustomInfo.isSendVideo);
  41. videoClose.SetActive(CustomInfo.isSendVideo);
  42. SystemDatas data = new SystemDatas();
  43. data.Camera = CustomInfo.isSendVideo ? 1 : 0;
  44. data.Mic = CustomInfo.isSendAudio ? 1 : 0;
  45. SaveSystemData(data);
  46. }
  47. private void SaveSystemData(SystemDatas data)
  48. {
  49. UserInfo.systemDatas = data;
  50. string saveData = JsonConvert.SerializeObject(data);
  51. Debug.Log(saveData);
  52. PlayerPrefs.SetString(UserInfo.Account + "_SystemSetting", saveData);
  53. }
  54. }