using Newtonsoft.Json; using SC.XR.Unity; using System.Collections.Generic; using UnityEngine; using static ScenesManager; public class RemoteSystem : RemoteSingleton { 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); SaveSystemData(); } public void videoChoose() { CustomInfo.isSendVideo = !CustomInfo.isSendVideo; videoOpen.SetActive(!CustomInfo.isSendVideo); videoClose.SetActive(CustomInfo.isSendVideo); SaveSystemData(); } private void SaveSystemData() { SystemDatas data = new SystemDatas(); data.Camera = CustomInfo.isSendVideo ? 1 : 0; data.Mic = CustomInfo.isSendAudio ? 1 : 0; string saveData = JsonConvert.SerializeObject(data); Debug.Log(saveData); PlayerPrefs.SetString(UserInfo.Account + "_SystemSetting", saveData); } }