123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190 |
- 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;
- }
|