using UnityEngine; using Newtonsoft.Json.Linq; using System.Collections.Generic; /// /// 配置数据结构 /// public class ConfigObject:Dictionary{} /// /// 已知设置可以在这里添加 /// class LocalSettings { static int _comboCount = 0; static float _battleRuntime = 0; /// /// 这里我是定义了一个布尔变量, 也可以定义结构复杂的类型, /// 同样利用Value方法转为强类型,然后在其他地方使用. /// 默认值的话,需要自己处理好,因为,一开始可能并不存在这个变量. /// static public bool IsBeginAnimationPlayed { get { var r = GameCfg.LocalSettings["BeginAnimationPlayed"]; return (null != r ? r.Value() : false); // 默认值 } set { GameCfg.LocalSettings["BeginAnimationPlayed"] = value; } } static public string DefaultUserName { get { var r = GameCfg.LocalSettings["DefaultUserName"]; return (null != r ? r.Value() : ""); // 默认值 } set { GameCfg.LocalSettings["DefaultUserName"] = value; } } static public string DefaultPassword { get { var r = GameCfg.LocalSettings["DefaultPassword"]; return (null != r ? r.Value() : ""); // 默认值 } set { GameCfg.LocalSettings["DefaultPassword"] = value; } } static public bool IsAgreementChecked { get { var b = GameCfg.LocalSettings["IsAgreementChecked"]; return (null != b ? b.Value() : false); } set { GameCfg.LocalSettings["IsAgreementChecked"] = value; } } static public int LoadingWinSmallTipsIndex { get { var b = GameCfg.LocalSettings["LoadingWinSmallTipsIndex"]; return (null != b ? b.Value() : 0); } set { GameCfg.LocalSettings["LoadingWinSmallTipsIndex"] = value; } } /// /// 设置当前主界面 /// static public string DisplayHeroUID { get { var r = GameCfg.LocalSettings["DisplayHeroUID"]; return (null != r ? r.Value() : ""); // 默认值 } set { GameCfg.LocalSettings["DisplayHeroUID"] = value; } } ///// ///// 设置个人配置队伍信息 ///// //static public Info_HeroTeamConfig MyFightTeam //{ // get // { // var r = GameCfg.LocalSettings["MyFightTeam"]; // return (null != r ? r.ToObject() : null); // 默认值 // } // set // { // JToken ttoke = JToken.FromObject(value); // GameCfg.LocalSettings["MyFightTeam"] = ttoke; // } //} /// /// /// static public int MusicVolume { get { var r = GameCfg.LocalSettings["MusicVolume"]; return (null != r ? r.Value() : 50); // 默认值 } set { GameCfg.LocalSettings["MusicVolume"] = value; } } /// /// /// static public int EffectVolume { get { var r = GameCfg.LocalSettings["EffectVolume"]; return (null != r ? r.Value() : 50); // 默认值 } set { GameCfg.LocalSettings["EffectVolume"] = value; } } /// /// 关卡地图弹出的状态记录 /// 1= 直接进入地图放大状态,显示当前所在位置 /// 0= 世界地图模式状态 /// static public int ArenasMapFlag_IsNewPlayer { get { var r = GameCfg.LocalSettings["ArenasMapFlag"]; return (null != r ? r.Value() : 0); // 默认值 } set { GameCfg.LocalSettings["ArenasMapFlag"] = value; } } /// /// /// static public int PlayerImageBorderId { get { var r = GameCfg.LocalSettings["PlayerImageBorderId"]; return (null != r ? r.Value() : 0); // 默认值 } set { GameCfg.LocalSettings["PlayerImageBorderId"] = value; } } /// /// 最大连击 /// static public int MaxCombCount { get; set; } /// /// 战斗连击 /// static public int BattleComboCount { get { return _comboCount; } set { _comboCount = value; } } /// /// 战斗用时 /// static public float BattleRuntime { get { return _battleRuntime; } set { _battleRuntime = value; } } }