예제 #1
0
        public void LoadCnf()
        {
            List <List <string> > contents =
                CnfHelper.GetContext(Application.dataPath + "/../Report/common/纹理.csv");

            SetInfo(contents);
        }
예제 #2
0
    public static void ReadLocalConfig()
    {
        StaticCnf.Clear();
        int length = 0;
        Dictionary <string, BaseCsvInfo> csv_infos = CnfHelper.LoadFileContent();
        BaseCsvInfo info = null;

        info = csv_infos["BuffCnf"];
        Dictionary <int, BuffCnf> buffcnf = new Dictionary <int, BuffCnf>();

        length = info._datas.Count;
        for (int i = 0; i < length; i++)
        {
            BuffCnf tmp = new BuffCnf();
            tmp.ToLocalRead(info._datas[i]);
            buffcnf.Add(tmp.id, tmp);
        }
        StaticCnf.Add(buffcnf);

        info = csv_infos["BuffEffectCnf"];
        Dictionary <int, BuffEffectCnf> buffeffectcnf = new Dictionary <int, BuffEffectCnf>();

        length = info._datas.Count;
        for (int i = 0; i < length; i++)
        {
            BuffEffectCnf tmp = new BuffEffectCnf();
            tmp.ToLocalRead(info._datas[i]);
            buffeffectcnf.Add(tmp.id, tmp);
        }
        StaticCnf.Add(buffeffectcnf);

        info = csv_infos["HeroInfoCnf"];
        Dictionary <int, HeroInfoCnf> heroinfocnf = new Dictionary <int, HeroInfoCnf>();

        length = info._datas.Count;
        for (int i = 0; i < length; i++)
        {
            HeroInfoCnf tmp = new HeroInfoCnf();
            tmp.ToLocalRead(info._datas[i]);
            heroinfocnf.Add(tmp.id, tmp);
        }
        StaticCnf.Add(heroinfocnf);

        info = csv_infos["SpellInfoCnf"];
        Dictionary <int, SpellInfoCnf> spellinfocnf = new Dictionary <int, SpellInfoCnf>();

        length = info._datas.Count;
        for (int i = 0; i < length; i++)
        {
            SpellInfoCnf tmp = new SpellInfoCnf();
            tmp.ToLocalRead(info._datas[i]);
            spellinfocnf.Add(tmp.id, tmp);
        }
        StaticCnf.Add(spellinfocnf);
    }
예제 #3
0
        /// <summary>
        /// 根据.csv创建.cs文件
        /// </summary>
        public static void CreateCode()
        {
            // 1.读取指定目录下的所有文件
            Dictionary <string, BaseCsvInfo> csv_infos = CnfHelper.LoadFileContent();
            // 2.创建数据结构类
            List <EClassDefine> class_map = CreateClass(csv_infos);

            // 确认文件夹已经创建
            FileHelper.CreateDirectory(CnfConst.cnf_path);
            // 3.导出
            int length = class_map.Count;

            for (int i = 0; i < length; i++)
            {
                File.WriteAllText(class_map[i].file_path, class_map[i].ToDes());
            }

            string config_text = CreateClassManager(csv_infos);

            File.WriteAllText(CodeGeneratorConstE.config_cs_path, config_text);
            //EditorUtility.DisplayDialog("Csv转成Cs", "运行结束,请查看结果", "Ok");
        }
예제 #4
0
        public void AddData()
        {
            _effcnfs.Clear();

            List <List <string> > contents =
                CnfHelper.GetContext(Application.dataPath + "/../Report/Effect_Report.csv");

            int length = contents.Count;

            for (int i = 0; i < length; i++)
            {
                CheckEffectReportCnf info = new CheckEffectReportCnf();
                info.SetInfo(contents[i]);
                _effcnfs.Add(info);
            }

            _shows.Clear();
            length = _effcnfs.Count;
            for (int i = 0; i < length; i++)
            {
                _shows.Add(_effcnfs[i]);
            }
        }