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);
     }
 }
Example #5
0
 protected override void LoadSettingOnOpen(ExpSetting expSetting)
 {
     if (_light == null)
     {
         _light = GetComponent <Light>();
     }
     OnLightChange(expSetting.LightStrength);
 }
Example #6
0
 private void OnLoadSetting(ExpSetting arg0)
 {
     if (arg0 != null)
     {
         _expSetting = arg0;
         LoadSettingOnOpen(arg0);
         RegistEventOnSettingChange(arg0);
     }
 }
Example #7
0
    ///// <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;
    }
Example #8
0
    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;
 }
Example #12
0
 protected override void RemoveEventOnSettingChange(ExpSetting expSetting)
 {
     expSetting.cg_PlayerSpeed -= OnSpeedChanged;
 }
Example #13
0
 protected override void RemoveEventOnSettingChange(ExpSetting expSetting)
 {
     expSetting.cg_FontSize -= OnFontSizeChange;
 }
Example #14
0
 protected override void LoadSettingOnOpen(ExpSetting expSetting)
 {
     OnFontSizeChange(expSetting.fontSize);
 }
Example #15
0
 protected override void RemoveEventOnSettingChange(ExpSetting expSetting)
 {
     expSetting.cg_LightStrength -= OnLightChange;
 }
Example #16
0
 protected override void LoadSettingOnOpen(ExpSetting expSetting)
 {
     OnSpeedChanged(expSetting.PlayerSpeed);
 }
Example #17
0
 protected abstract void LoadSettingOnOpen(ExpSetting expSetting);
Example #18
0
 protected abstract void RemoveEventOnSettingChange(ExpSetting expSetting);
Example #19
0
 void OnLoadSettingData(ExpSetting proxy)
 {
     setting = proxy;
     ligthStrigthSld.value = setting.lightStrength;
 }