12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- using Newtonsoft.Json;
- using SC.XR.Unity;
- using System.Collections.Generic;
- using UnityEngine;
- using static ScenesManager;
- public class RemoteSystem : RemoteSingleton<RemoteSystem>
- {
- public GameObject audioOpen;
- public GameObject audioClose;
- public GameObject videoOpen;
- public GameObject videoClose;
- public NormalList sysList;
- public override void initShow()
- {
- base.initShow();
- sysList.initList(CustomInfo.sscList);
- audioOpen.SetActive(!CustomInfo.isSendAudio);
- audioClose.SetActive(CustomInfo.isSendAudio);
- videoOpen.SetActive(!CustomInfo.isSendVideo);
- videoClose.SetActive(CustomInfo.isSendVideo);
- }
- public void showOffice()
- {
- NetWorkHeaders.SetUserSys(CustomInfo.isSendAudio, CustomInfo.isSendVideo, CustomInfo.camIndex);
- ScenesManager.Instance.showOffice(SceneType.OfficeWindow);
- }
- public void audioChoose()
- {
- CustomInfo.isSendAudio = !CustomInfo.isSendAudio;
- audioOpen.SetActive(!CustomInfo.isSendAudio);
- audioClose.SetActive(CustomInfo.isSendAudio);
- SystemDatas data = new SystemDatas();
- data.Camera = CustomInfo.isSendVideo ? 1 : 0;
- data.Mic = CustomInfo.isSendAudio ? 1 : 0;
- SaveSystemData(data);
- }
- public void videoChoose()
- {
- CustomInfo.isSendVideo = !CustomInfo.isSendVideo;
- videoOpen.SetActive(!CustomInfo.isSendVideo);
- videoClose.SetActive(CustomInfo.isSendVideo);
- SystemDatas data = new SystemDatas();
- data.Camera = CustomInfo.isSendVideo ? 1 : 0;
- data.Mic = CustomInfo.isSendAudio ? 1 : 0;
- SaveSystemData(data);
- }
- private void SaveSystemData(SystemDatas data)
- {
- UserInfo.systemDatas = data;
- string saveData = JsonConvert.SerializeObject(data);
- Debug.Log(saveData);
- PlayerPrefs.SetString(UserInfo.Account + "_SystemSetting", saveData);
- }
- }
|