Beispiel #1
0
        /// <summary>
        /// 输出文件
        /// </summary>
        private void Output()
        {
            //检出输出目录
            if (!Directory.Exists(cache.configOutputFolder))
            {
                Directory.CreateDirectory(cache.configOutputFolder);
            }

            //源
            List <Source> sources = GetSources();

            //生产Configs
            ConfigGenerator.Generate(sources, cache.configOutputFolder);

            //生产SerializableSet
            SerializableSetGenerator.Generate(sources, cache.configOutputFolder);

            //生产Deserializer
            DeserializerGenerator.Generate(sources, cache.configOutputFolder);

            //刷新
            AssetDatabase.Refresh();

            //等待序列化
            if (EditorApplication.isCompiling)
            {
                waitingForSerialize = true;
                Debug.Log("输出完成,正在等待Unity编译后序列化数据...");
            }
            else
            {
                Serialize();
            }
        }
Beispiel #2
0
        /// <summary>
        /// 输出文件
        /// </summary>
        private void Output()
        {
            //检出输出目录
            if (!Directory.Exists(cache.configOutputFolder))
            {
                Directory.CreateDirectory(cache.configOutputFolder);
            }
            if (!Directory.Exists(cache.serializerOutputFolder))
            {
                Directory.CreateDirectory(cache.serializerOutputFolder);
            }

            //获取源
            List <SheetSource>  sheets;  //表格
            List <StructSource> structs; //结构

            GetSources(out sheets, out structs);

            if (sheets.Count == 0 && structs.Count == 0)
            {
                Debug.LogError(cache.sourceFolder + "没有找到任何文件!");
                return;
            }

            SheetGenerator.Generate(sheets, cache.configOutputFolder);   //生产Configs
            StructGenerator.Generate(structs, cache.configOutputFolder); //生成Jsons

            //生产SerializableSet
            SerializableSetGenerator.Generate(sheets, structs, cache.serializerOutputFolder);

            //生产Deserializer
            DeserializerGenerator.Generate(sheets, structs, cache.serializerOutputFolder);

            //刷新
            AssetDatabase.Refresh();

            //等待序列化
            if (EditorApplication.isCompiling)
            {
                waitingForSerialize = true;
                Debug.Log("输出完成,正在等待Unity编译后序列化数据...");
            }
            else
            {
                Serialize();
            }
        }