public void LoadCSV() { list_AvatarModelData = AvatarModelData.LoadDatas(); list_CameraAnimData = CameraAnimData.LoadDatas(); list_EffectData = EffectData.LoadDatas(); list_EquipData = EquipData.LoadDatas(); list_GameBaseData = GameBaseData.LoadDatas(); list_GameSceneData = GameSceneData.LoadDatas(); list_GoodsData = GoodsData.LoadDatas(); list_MonsterData = MonsterData.LoadDatas(); list_ResourceData = ResourceData.LoadDatas(); list_SkillAction = SkillAction.LoadDatas(); list_SkillData = SkillData.LoadDatas(); }
public static List <EquipData> LoadDatas() { CSVFile csvFile = new CSVFile(); csvFile.Open(csvFilePath); dataList = new List <EquipData>(); dataMap = new Dictionary <int, EquipData>(); string[] strs; string[] strsTwo; List <int> listChild; columnNameArray = new string[13]; for (int i = 0; i < csvFile.mapData.Count; i++) { EquipData data = new EquipData(); int.TryParse(csvFile.mapData[i].data[0], out data.id); columnNameArray [0] = "id"; data.type = new List <int>(); strs = csvFile.mapData[i].data[1].Split(new char[1] { ',' }); for (int j = 0; j < strs.Length; j++) { data.type.Add(int.Parse(strs[j])); } columnNameArray [1] = "type"; data.prefabPath = new List <string>(); strs = csvFile.mapData[i].data[2].Split(new char[1] { ',' }); for (int j = 0; j < strs.Length; j++) { data.prefabPath.Add(strs[j]); } columnNameArray [2] = "prefabPath"; data.mesh = csvFile.mapData[i].data[3]; columnNameArray [3] = "mesh"; data.material = csvFile.mapData[i].data[4]; columnNameArray [4] = "material"; data.slot = new List <string>(); strs = csvFile.mapData[i].data[5].Split(new char[1] { ',' }); for (int j = 0; j < strs.Length; j++) { data.slot.Add(strs[j]); } columnNameArray [5] = "slot"; data.slotInCity = new List <string>(); strs = csvFile.mapData[i].data[6].Split(new char[1] { ',' }); for (int j = 0; j < strs.Length; j++) { data.slotInCity.Add(strs[j]); } columnNameArray [6] = "slotInCity"; int.TryParse(csvFile.mapData[i].data[7], out data.priority); columnNameArray [7] = "priority"; int.TryParse(csvFile.mapData[i].data[8], out data.putOnMethod); columnNameArray [8] = "putOnMethod"; int.TryParse(csvFile.mapData[i].data[9], out data.suit); columnNameArray [9] = "suit"; int.TryParse(csvFile.mapData[i].data[10], out data.suitCount); columnNameArray [10] = "suitCount"; int.TryParse(csvFile.mapData[i].data[11], out data.isWeapon); columnNameArray [11] = "isWeapon"; data.subEquip = new List <int>(); strs = csvFile.mapData[i].data[12].Split(new char[1] { ',' }); for (int j = 0; j < strs.Length; j++) { data.subEquip.Add(int.Parse(strs[j])); } columnNameArray [12] = "subEquip"; dataList.Add(data); if (!dataMap.ContainsKey(data.id)) { dataMap.Add(data.id, data); } } return(dataList); }