// 根据id获得天赋效果信息 public void GetTalentEffectInfo(int nTalentEffectId, ref SSchemeTalentEffectConfig sTalentEffect) { if (!IsHasTalentEffectInfo(nTalentEffectId, ref sTalentEffect)) { Trace.LogWarning("没有找到id为:" + nTalentEffectId + "的天赋"); sTalentEffect = null; } }
// 判断是否有该id的天赋效果信息 private bool IsHasTalentEffectInfo(int nTalentEffectId, ref SSchemeTalentEffectConfig sTalentEffect) { bool res = false; if (allTalentEffectTable.ContainsKey(nTalentEffectId)) { sTalentEffect = allTalentEffectTable[nTalentEffectId] as SSchemeTalentEffectConfig; res = true; } return(res); }
// 初始化csv表 protected void InitTalentEffectCsv(string stPath) { // string stSchemeAllText = File.ReadAllText(stPath); ScpReader reader = new ScpReader(stPath, true, 2); allTalentEffectTable = new Hashtable(); for (int i = 0; i < reader.GetRecordCount(); i++) { SSchemeTalentEffectConfig sConfig = new SSchemeTalentEffectConfig(); sConfig.nEffectArrayId = reader.GetInt(i, (int)TalentEffect.EMT_EFFECCT_ID, 0); sConfig.szEffectArray = reader.GetString(i, (int)TalentEffect.EMT_EFFECCT_ARRAY, ""); sConfig.szTalentDESC = reader.GetString(i, (int)TalentEffect.EMT_EFFECT_DESC, ""); if (sConfig.nEffectArrayId == 0) { continue; } allTalentEffectTable[sConfig.nEffectArrayId] = sConfig; } }