示例#1
0
 public void LoadCSV()
 {
     list_CardData      = CardData.LoadDatas();
     list_GameBaseData  = GameBaseData.LoadDatas();
     list_GameSceneData = GameSceneData.LoadDatas();
     list_GoodsData     = GoodsData.LoadDatas();
     list_JettonData    = JettonData.LoadDatas();
     list_ResourceData  = ResourceData.LoadDatas();
 }
示例#2
0
 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 <GameBaseData> LoadDatas()
        {
            CSVFile csvFile = new CSVFile();

            csvFile.Open(csvFilePath);
            dataList = new List <GameBaseData>();
            dataMap  = new Dictionary <int, GameBaseData>();
            string[]   strs;
            string[]   strsTwo;
            List <int> listChild;

            columnNameArray = new string[12];
            for (int i = 0; i < csvFile.mapData.Count; i++)
            {
                GameBaseData data = new GameBaseData();
                int.TryParse(csvFile.mapData[i].data[0], out data.id);
                columnNameArray [0] = "id";
                float.TryParse(csvFile.mapData[i].data[1], out data.forwardSpeed);
                columnNameArray [1] = "forwardSpeed";
                float.TryParse(csvFile.mapData[i].data[2], out data.backwardsSpeed);
                columnNameArray [2] = "backwardsSpeed";
                float.TryParse(csvFile.mapData[i].data[3], out data.sidewaysSpeed);
                columnNameArray [3] = "sidewaysSpeed";
                int.TryParse(csvFile.mapData[i].data[4], out data.hp);
                columnNameArray [4] = "hp";
                float.TryParse(csvFile.mapData[i].data[5], out data.zhunxingMinValue);
                columnNameArray [5] = "zhunxingMinValue";
                float.TryParse(csvFile.mapData[i].data[6], out data.zhunxingMaxValue);
                columnNameArray [6] = "zhunxingMaxValue";
                float.TryParse(csvFile.mapData[i].data[7], out data.zhunxingStepValue);
                columnNameArray [7] = "zhunxingStepValue";
                data.heartSound     = csvFile.mapData[i].data[8];
                columnNameArray [8] = "heartSound";
                float.TryParse(csvFile.mapData[i].data[9], out data.luopanMaxDis);
                columnNameArray [9] = "luopanMaxDis";
                float.TryParse(csvFile.mapData[i].data[10], out data.luopanMidDis);
                columnNameArray [10] = "luopanMidDis";
                float.TryParse(csvFile.mapData[i].data[11], out data.luopanMinDis);
                columnNameArray [11] = "luopanMinDis";
                dataList.Add(data);
                if (!dataMap.ContainsKey(data.id))
                {
                    dataMap.Add(data.id, data);
                }
            }
            return(dataList);
        }