123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347 |
- using System;
- using UnityEngine;
- public class ConfigMgr : BaseMgr<ConfigMgr>
- {
- private void Start()
- {
- }
- private void Init()
- {
- string rootPath = "__GameMain__/SystemUI Root";
- this.m_goPanel = base.GetPanel("ConfigPanel", rootPath);
- this.m_configCtrl = base.GetCtrl<ConfigCtrl>();
- this.m_configCtrl.Init(this.m_goPanel);
- this.m_uiPanel = this.m_goPanel.GetComponent<UIPanel>();
- this.m_goPanel.SetActive(false);
- this.m_bInited = true;
- this.ChangeNormalConfig();
- }
- public bool IsOpenConfigPanel()
- {
- return !(this.m_goPanel == null) && this.m_goPanel.activeSelf;
- }
- public void OnSysButtonShowAlwaysEnabled()
- {
- this.m_configCtrl.SetButtonShowAlwaysEnabled(true);
- }
- public void OnSysButtonShowAlwaysDisabled()
- {
- this.m_configCtrl.SetButtonShowAlwaysEnabled(false);
- }
- public void OnFullScreenEnabled()
- {
- this.m_configCtrl.SetFullScreenEnabled(true);
- }
- public void OnFullScreenDisabled()
- {
- this.m_configCtrl.SetFullScreenEnabled(false);
- }
- public void OnResolutionChange()
- {
- if (!this.m_bInited)
- {
- return;
- }
- string value = UIPopupList.current.value;
- this.m_configCtrl.ChangePopupListResolutionValue(value);
- }
- public void OnAntiAliasChange()
- {
- if (!this.m_bInited)
- {
- return;
- }
- string value = UIPopupList.current.value;
- base.IsValidatePopupValue<CMSystem.AntiAliasType>(value);
- this.m_configCtrl.ChangePopupListValue<CMSystem.AntiAliasType>(value);
- }
- public void OnShadowQualityChange()
- {
- if (!this.m_bInited)
- {
- return;
- }
- string value = UIPopupList.current.value;
- base.IsValidatePopupValue<CMSystem.ShadowQualityType>(value);
- this.m_configCtrl.ChangePopupListValue<CMSystem.ShadowQualityType>(value);
- }
- public void OnTextureQualityChange()
- {
- if (!this.m_bInited)
- {
- return;
- }
- string value = UIPopupList.current.value;
- base.IsValidatePopupValue<CMSystem.TextureQualityType>(value);
- this.m_configCtrl.ChangePopupListValue<CMSystem.TextureQualityType>(value);
- }
- public void OnFpsDisplayEnabled()
- {
- this.m_configCtrl.SetFpsDisplayEnabled(true);
- }
- public void OnFpsDisplayDisabled()
- {
- this.m_configCtrl.SetFpsDisplayEnabled(false);
- }
- public void OnCaptureMagnificationChange()
- {
- if (!this.m_bInited)
- {
- return;
- }
- string value = UIPopupList.current.value;
- base.IsValidatePopupValue<CMSystem.SSSuperSizeType>(value);
- this.m_configCtrl.ChangePopupListValue<CMSystem.SSSuperSizeType>(value);
- }
- public void OnBloomChange()
- {
- if (!this.m_bInited)
- {
- return;
- }
- float value = UIProgressBar.current.value;
- this.m_configCtrl.ChangeSliderValue(ConfigMgr.SliderType.Bloom, value);
- }
- public void OnPlayerModelTransparencyChange()
- {
- if (!this.m_bInited)
- {
- return;
- }
- float value = UIProgressBar.current.value;
- this.m_configCtrl.ChangeSliderValue(ConfigMgr.SliderType.PlayerModelTransparency, value);
- }
- public void OnMessageWindowTransparencyChange()
- {
- if (!this.m_bInited)
- {
- return;
- }
- float value = UIProgressBar.current.value;
- this.m_configCtrl.ChangeSliderValue(ConfigMgr.SliderType.MessageWindowTransparency, value);
- }
- public void OnTextSpeedChange()
- {
- if (!this.m_bInited)
- {
- return;
- }
- float value = UIProgressBar.current.value;
- this.m_configCtrl.ChangeSliderValue(ConfigMgr.SliderType.TextSpeed, value);
- }
- public void OnAutoSpeedChange()
- {
- if (!this.m_bInited)
- {
- return;
- }
- float value = UIProgressBar.current.value;
- this.m_configCtrl.ChangeSliderValue(ConfigMgr.SliderType.AutoSpeed, value);
- }
- public void OnMasterVolumeChange()
- {
- if (!this.m_bInited)
- {
- return;
- }
- float value = UIProgressBar.current.value;
- this.m_configCtrl.ChangeSliderValue(ConfigMgr.SliderType.MasterVolume, value);
- }
- public void OnSystemVolumeChange()
- {
- if (!this.m_bInited)
- {
- return;
- }
- float value = UIProgressBar.current.value;
- this.m_configCtrl.ChangeSliderValue(ConfigMgr.SliderType.SystemVolume, value);
- }
- public void OnMusicVolumeChange()
- {
- if (!this.m_bInited)
- {
- return;
- }
- float value = UIProgressBar.current.value;
- this.m_configCtrl.ChangeSliderValue(ConfigMgr.SliderType.MusicVolume, value);
- }
- public void OnDanceVolumeChange()
- {
- if (!this.m_bInited)
- {
- return;
- }
- float value = UIProgressBar.current.value;
- this.m_configCtrl.ChangeSliderValue(ConfigMgr.SliderType.DanceVolume, value);
- }
- public void OnVoiceVolumeChange()
- {
- if (!this.m_bInited)
- {
- return;
- }
- float value = UIProgressBar.current.value;
- this.m_configCtrl.ChangeSliderValue(ConfigMgr.SliderType.VoiceVolume, value);
- }
- public void OnSoundEffectVolumeChange()
- {
- if (!this.m_bInited)
- {
- return;
- }
- float value = UIProgressBar.current.value;
- this.m_configCtrl.ChangeSliderValue(ConfigMgr.SliderType.SoundEffectVolume, value);
- }
- public void OnSoundEnvironmentVolumeChange()
- {
- if (!this.m_bInited)
- {
- return;
- }
- float value = UIProgressBar.current.value;
- this.m_configCtrl.ChangeSliderValue(ConfigMgr.SliderType.SoundEnvironmentVolume, value);
- }
- public void OnAlreadyReadSkipEnabled()
- {
- this.m_configCtrl.SetAlreadyReadSkipEnabled(true);
- }
- public void OnAlreadyReadSkipDisabled()
- {
- this.m_configCtrl.SetAlreadyReadSkipEnabled(false);
- }
- public void OnSequentialVoiceEnabled()
- {
- this.m_configCtrl.SetSequentialVoiceEnabled(true);
- }
- public void OnSequentialVoiceDisabled()
- {
- this.m_configCtrl.SetSequentialVoiceEnabled(false);
- }
- public void SetEjaculationSeEnabled()
- {
- this.m_configCtrl.SetEjaculationSeEnabled(true);
- }
- public void SetEjaculationSeDisabled()
- {
- this.m_configCtrl.SetEjaculationSeEnabled(false);
- }
- public void OnMusic3DActive()
- {
- this.m_configCtrl.SetMusic3DActive();
- }
- public void OnVoice3DActive()
- {
- this.m_configCtrl.SetVoice3DActive();
- }
- public void OnSoundEffect3DActive()
- {
- this.m_configCtrl.SetSoundEffect3DActive();
- }
- public void OnSoundEnvironment3DActive()
- {
- this.m_configCtrl.SetSoundEnvironment3DActive();
- }
- public void OpenConfigPanel()
- {
- if (!this.m_bInited)
- {
- this.Init();
- }
- this.m_configCtrl.LoadConfigData();
- this.m_configCtrl.SetOKButtonActive(true);
- this.m_goPanel.SetActive(true);
- TweenAlpha tweenAlpha = this.m_goPanel.AddComponent<TweenAlpha>();
- tweenAlpha.from = 0f;
- tweenAlpha.to = 1f;
- tweenAlpha.duration = 0.3f;
- tweenAlpha.PlayForward();
- }
- public void CloseConfigPanel()
- {
- this.m_configCtrl.SetOKButtonActive(false);
- this.cblConfig.OnClose();
- TweenAlpha tweenAlpha = TweenAlpha.Begin(this.m_goPanel, 0.3f, 0f);
- EventDelegate.Set(tweenAlpha.onFinished, delegate
- {
- this.m_goPanel.SetActive(false);
- });
- GameMain.Instance.BroadcastMessage("OnChangeScreenSizeOrAA", SendMessageOptions.DontRequireReceiver);
- }
- public void ChangeNormalConfig()
- {
- this.m_configCtrl.SetContentsVisible(true);
- this.cblConfig.visible = false;
- }
- public void ChangeCBLConfig()
- {
- this.m_configCtrl.SetContentsVisible(false);
- this.cblConfig.visible = true;
- }
- [SerializeField]
- public ConfigCblManager cblConfig;
- private ConfigCtrl m_configCtrl;
- private const float DURATION_TO_FADE = 0.3f;
- private UIPanel m_uiPanel;
- private bool m_bInited;
- public enum SliderType
- {
- Bloom,
- PlayerModelTransparency,
- MessageWindowTransparency,
- TextSpeed,
- AutoSpeed,
- MasterVolume,
- SystemVolume,
- MusicVolume,
- DanceVolume,
- VoiceVolume,
- SoundEffectVolume,
- SoundEnvironmentVolume
- }
- }
|