public void Load() { mDicHeroConfig.Clear(); TextAsset TXTFile = (TextAsset)Resources.Load("Config/Hero"); string strText = TXTFile.text.Replace("\r\n", "|"); string[] split = strText.Split('|'); int nAmount = split.Length; int i; int nTypeID = 0; for (i = 0; i < nAmount; ++i) { stHeroCfg stInfo = new stHeroCfg(); string[] spInfos = split[i].Split(','); if (spInfos.Length != 14) { Debug.Log("HeroConfig Load spInfos.Length != 14\n"); } else { nTypeID = int.Parse(spInfos[0]); stInfo.strName = spInfos[1]; stInfo.strFigure = spInfos[2]; stInfo.nMaxQuality = int.Parse(spInfos[3]); stInfo.nBlood = int.Parse(spInfos[4]); stInfo.nAddBlood = int.Parse(spInfos[5]); stInfo.nAttack = int.Parse(spInfos[6]); stInfo.nAttackAdd = int.Parse(spInfos[7]); stInfo.nMagicPower = int.Parse(spInfos[8]); stInfo.nHeroCareer = int.Parse(spInfos[9]); stInfo.strProjectile = spInfos[10]; stInfo.nAttackRange = int.Parse(spInfos[11]); stInfo.nAttackDelay = int.Parse(spInfos[12]); stInfo.nCoolDownTimer = int.Parse(spInfos[13]); mDicHeroConfig[nTypeID] = stInfo; } } }
public void setHeroConfig(stHeroCfg pHeroConfig) { m_pHeroConfig = pHeroConfig; }