protected override void RemoveEventOnSettingChange(ExpSetting expSetting) { if (_audioManager) { expSetting.cg_ButtonAudio -= OnButtonAudioStateChange; } }
protected override void LoadSettingOnOpen(ExpSetting expSetting) { if (_audioManager) { OnButtonAudioStateChange(expSetting.ButtonAudio); } }
protected override void LoadSettingOnOpen(ExpSetting expSetting) { _transfrom = transform; _person = GetComponent <PersonCharacter>(); OnCamerHightChange(expSetting.cameraHight); OnSpeedChange(expSetting.playerSpeed); }
public override void Execute(bool notification) { //加载 if (notification == true) { if (!File.Exists(filePath)) { CreateDefultSetting(); } else { expSetting = classCache.LoadClassFromLocal <ExpSetting>(filename); if (expSetting == null) { CreateDefultSetting(); } } Facade.RegisterProxy(new Proxy <ExpSetting>(AppConfig.EventKey.SettngData, expSetting)); } //保存 else { classCache.SaveClassToLocal(expSetting.GetSaveAbleCopy(), filename); } }
protected override void LoadSettingOnOpen(ExpSetting expSetting) { if (_light == null) { _light = GetComponent <Light>(); } OnLightChange(expSetting.LightStrength); }
private void OnLoadSetting(ExpSetting arg0) { if (arg0 != null) { _expSetting = arg0; LoadSettingOnOpen(arg0); RegistEventOnSettingChange(arg0); } }
///// <summary> ///// 主题颜色选择 ///// </summary> ///// <param name="image"></param> //private void SelectMainColor() //{ // ColorChoisePanel.Data data = new global::ColorChoisePanel.Data(); // data.startColor = mainColrField.image.color; // data.onColorChanged = (x) => // { // x.a = 1; // mainColrField.image.color = x; // }; // UIGroup.Open<ColorChoisePanel>(data); //} ///// <summary> ///// 提示色选择 ///// </summary> //private void SelectNoticColor() //{ // ColorChoisePanel.Data data = new global::ColorChoisePanel.Data(); // data.startColor = selectColorField.image.color; // data.onColorChanged = (x) => // { // x.a = 1; // selectColorField.image.color = x; // }; // UIGroup.Open<ColorChoisePanel>(data); //} void OnLoadSettingData(ExpSetting proxy) { setting = proxy; //guideTog.isOn = setting.guide; cameraHightSld.value = setting.cameraHight; playerSpeedSld.value = setting.playerSpeed; ligthStrigthSld.value = setting.lightStrength; //selectFontSize.value = setting.fontSize; ////mainColrField.image.color = setting.WindowColor; ////selectColorField.image.color = setting.SelectColor; //humanVoiceTog.isOn = setting.humanVoice; //buttonAudioTog.isOn = setting.buttonAudio; }
public ExpSetting GetSaveAbleCopy() { ExpSetting setting = new ExpSetting(); setting.guide = guide; setting.cameraHight = cameraHight; setting.playerSpeed = playerSpeed; setting.lightStrength = lightStrength; setting.volume = volume; setting.windowColor = windowColor; setting.selectColor = selectColor; setting.humanVoice = humanVoice; setting.buttonAudio = buttonAudio; return(setting); }
private static void InitExpSetting() { if (PlayerPrefs.HasKey(playPer)) { var value = PlayerPrefs.GetString(playPer); if (!string.IsNullOrEmpty(value)) { expSetting = JsonUtility.FromJson <ExpSetting>(value); } } if (expSetting == null) { expSetting = new global::ExpSetting(); expSetting.ResetDefult(); } }
static void CreateDefultSetting() { expSetting = new global::ExpSetting(); expSetting.ResetDefult(); }
protected override void RemoveEventOnSettingChange(ExpSetting expSetting) { expSetting.cg_CameraHight -= OnCamerHightChange; expSetting.cg_PlayerSpeed -= OnSpeedChange; }
protected override void RemoveEventOnSettingChange(ExpSetting expSetting) { expSetting.cg_PlayerSpeed -= OnSpeedChanged; }
protected override void RemoveEventOnSettingChange(ExpSetting expSetting) { expSetting.cg_FontSize -= OnFontSizeChange; }
protected override void LoadSettingOnOpen(ExpSetting expSetting) { OnFontSizeChange(expSetting.fontSize); }
protected override void RemoveEventOnSettingChange(ExpSetting expSetting) { expSetting.cg_LightStrength -= OnLightChange; }
protected override void LoadSettingOnOpen(ExpSetting expSetting) { OnSpeedChanged(expSetting.PlayerSpeed); }
protected abstract void LoadSettingOnOpen(ExpSetting expSetting);
protected abstract void RemoveEventOnSettingChange(ExpSetting expSetting);
void OnLoadSettingData(ExpSetting proxy) { setting = proxy; ligthStrigthSld.value = setting.lightStrength; }