using System.Collections; using System.Collections.Generic; using UnityEngine; public class BaseSetting : MonoBehaviour { public GameObject CameraOpenIcon; public GameObject CameraCloseIcon; public GameObject MicOpenIcon; public GameObject MicCloseIcon; public GameObject[] QesolutionIcons; public Game3DInputField g3dField; public void Start() { string dName = PlayerPrefs.GetString("name"); if(dName!=null&& dName!="") g3dField.text = dName; string isSendVideo = PlayerPrefs.GetString("isSendVideo"); string isSendAudio = PlayerPrefs.GetString("isSendAudio"); string SetFrame = PlayerPrefs.GetString("SetFrame"); string ChooseFPS = PlayerPrefs.GetString("ChooseFPS"); switch (isSendVideo) { case "Open": CustomInfo.isSendVideo = true; CameraOpenIcon.SetActive(CustomInfo.isSendVideo); CameraCloseIcon.SetActive(!CustomInfo.isSendVideo); break; case "Close": CustomInfo.isSendVideo = false; CameraOpenIcon.SetActive(CustomInfo.isSendVideo); CameraCloseIcon.SetActive(!CustomInfo.isSendVideo); break; default: CustomInfo.isSendVideo = true; CameraOpenIcon.SetActive(CustomInfo.isSendVideo); CameraCloseIcon.SetActive(!CustomInfo.isSendVideo); break; } isVideoGM.SetActive(!CustomInfo.isSendVideo); switch (isSendAudio) { case "Open": CustomInfo.isSendAudio = true; MicOpenIcon.SetActive(CustomInfo.isSendAudio); MicCloseIcon.SetActive(!CustomInfo.isSendAudio); break; case "Close": CustomInfo.isSendAudio = false; MicOpenIcon.SetActive(CustomInfo.isSendAudio); MicCloseIcon.SetActive(!CustomInfo.isSendAudio); break; default: CustomInfo.isSendAudio = true; MicOpenIcon.SetActive(CustomInfo.isSendAudio); MicCloseIcon.SetActive(!CustomInfo.isSendAudio); break; } isAudioGM.SetActive(!CustomInfo.isSendAudio); switch (ChooseFPS) { case "Super": ChooseSuper(); break; case "High": ChooseHigh(); break; case "Standard": ChooseStandard(); break; default: ChooseHigh(); break; } switch (ChooseFPS) { case "Super": SetFrameSuper(); break; case "High": SetFrameHigh(); break; case "Standard": SetFrameStandard(); break; default: SetFrameHigh(); break; } } public void changeCamera() { CustomInfo.isSendVideo = !CustomInfo.isSendVideo; CameraOpenIcon.SetActive(CustomInfo.isSendVideo); CameraCloseIcon.SetActive(!CustomInfo.isSendVideo); if (CustomInfo.isSendVideo) { PlayerPrefs.SetString("isSendVideo","Open"); }else { PlayerPrefs.SetString("isSendVideo", "Close"); } isVideoGM.SetActive(!CustomInfo.isSendVideo); SCRtcFactory.Instance.mSCRtcHandle.sendVideo(CustomInfo.isSendVideo); } public void changeCamera1() { CustomInfo.isSendVideo = !CustomInfo.isSendVideo; isVideoGM.SetActive(!CustomInfo.isSendVideo); SCRtcFactory.Instance.mSCRtcHandle.sendVideo(CustomInfo.isSendVideo); } public void changeMic() { CustomInfo.isSendAudio = !CustomInfo.isSendAudio; MicOpenIcon.SetActive(CustomInfo.isSendAudio); MicCloseIcon.SetActive(!CustomInfo.isSendAudio); if (CustomInfo.isSendAudio) { PlayerPrefs.SetString("isSendAudio", "Open"); } else { PlayerPrefs.SetString("isSendAudio", "Close"); } isAudioGM.SetActive(!CustomInfo.isSendAudio); SCRtcFactory.Instance.mSCRtcHandle.sendMic(CustomInfo.isSendAudio); } public void changeMic1() { CustomInfo.isSendAudio = !CustomInfo.isSendAudio; isAudioGM.SetActive(!CustomInfo.isSendAudio); SCRtcFactory.Instance.mSCRtcHandle.sendMic(CustomInfo.isSendAudio); } public ChooseManage chooseVideo; public ChooseManage chooseFPS; public void ChooseSuper() { CustomInfo.FPS = 60; chooseFPS.changeList(2); PlayerPrefs.SetString("ChooseFPS", "Super"); } public void ChooseHigh() { CustomInfo.FPS = 30; chooseFPS.changeList(1); PlayerPrefs.SetString("ChooseFPS", "High"); } public void ChooseStandard() { CustomInfo.FPS = 15; chooseFPS.changeList(0); PlayerPrefs.SetString("ChooseFPS", "Standard"); } public void SetFrameSuper() { CustomInfo.mWidth = 1920; CustomInfo.mHight = 1440; chooseVideo.changeList(2); PlayerPrefs.SetString("SetFrame", "Super"); } public void SetFrameHigh() { CustomInfo.mWidth = 640; CustomInfo.mHight = 480; chooseVideo.changeList(1); PlayerPrefs.SetString("SetFrame", "High"); } public void SetFrameStandard() { CustomInfo.mWidth = 320; CustomInfo.mHight = 240; chooseVideo.changeList(0); PlayerPrefs.SetString("SetFrame", "Standard"); } public GameObject isVideoGM; public GameObject isAudioGM; }