public static DeclareSkill Create(int in_can_use_select, int in_cd, int in_cell_id, int in_damage_type, string in_desc, int in_element_type, int in_icon, int in_id, int in_level, string in_name, string in_params, int in_params2, int in_prompt_delay, int in_prompt_life_time, string in_prompt_text, int in_public_cd, int in_server_sync_type, int in_skill_preferred, int in_type, int in_use_public_cd, int in_user_type, string in_visualDef) { DeclareSkill tmp = new DeclareSkill(); tmp._can_use_select = in_can_use_select; tmp._cd = in_cd; tmp._cell_id = in_cell_id; tmp._damage_type = in_damage_type; tmp._desc = in_desc; tmp._element_type = in_element_type; tmp._icon = in_icon; tmp._id = in_id; tmp._level = in_level; tmp._name = in_name; tmp._params = in_params; tmp._params2 = in_params2; tmp._prompt_delay = in_prompt_delay; tmp._prompt_life_time = in_prompt_life_time; tmp._prompt_text = in_prompt_text; tmp._public_cd = in_public_cd; tmp._server_sync_type = in_server_sync_type; tmp._skill_preferred = in_skill_preferred; tmp._type = in_type; tmp._use_public_cd = in_use_public_cd; tmp._user_type = in_user_type; tmp._visualDef = in_visualDef; return(tmp); }
public static void SetData() { if (_dataCaches == null && LuaEnv.isLoadLuaCfg) { long startTime = DateTime.Now.Ticks; Dictionary <int, int[]> dic = LuaEnv.SharedLuaEnv.Global.Get <Dictionary <int, int[]> >("DataSkill"); if (dic == null) { LuaEnv.SharedLuaEnv.DoString("DataSkill = require 'Lua/Config/DataSkill'"); dic = LuaEnv.SharedLuaEnv.Global.Get <Dictionary <int, int[]> >("DataSkill"); } if (dic != null) { _dataCaches = new Dictionary <int, DeclareSkill>(1804); foreach (var item in dic) { DeclareSkill tmp = new DeclareSkill(); tmp.CanUseSelect = item.Value[0]; tmp.Cd = item.Value[1]; tmp.CellId = item.Value[2]; tmp.DamageType = item.Value[3]; tmp.Desc = CfgStringLua.Get(item.Value[4]); tmp.ElementType = item.Value[5]; tmp.Icon = item.Value[6]; tmp.Id = item.Value[7]; tmp.Level = item.Value[8]; tmp.Name = CfgStringLua.Get(item.Value[9]); tmp.Params = CfgStringLua.Get(item.Value[10]); tmp.Params2 = item.Value[11]; tmp.PromptDelay = item.Value[12]; tmp.PromptLifeTime = item.Value[13]; tmp.PromptText = CfgStringLua.Get(item.Value[14]); tmp.PublicCd = item.Value[15]; tmp.ServerSyncType = item.Value[16]; tmp.SkillPreferred = item.Value[17]; tmp.Type = item.Value[18]; tmp.UsePublicCd = item.Value[19]; tmp.UserType = item.Value[20]; tmp.VisualDef = CfgStringLua.Get(item.Value[21]); _dataCaches.Add(item.Key, tmp); } } Record(startTime, DateTime.Now.Ticks, "Skill"); } if (_dataCaches == null && _fillDataCallBack != null) { if (_dataCaches == null) { long startTime = DateTime.Now.Ticks; _dataCaches = new Dictionary <int, DeclareSkill>(1804); _fillDataCallBack(_dataCaches); Record(startTime, DateTime.Now.Ticks, "Skill"); } } }