| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 | using System.Collections;using System.IO;using UnityEngine;namespace GFGEditor{    public class CodeTemplateFactory    {        public static string ConfigTemplate { get; private set; }        public static string ConfigArrayTemplate { get; private set; }        public static string InitTemplate { get; private set; }        public static string DisposeTemplate { get; private set; }        public static string FunctionSingleTemplate { get; private set; }        public static string FunctionGroupTemplate { get; private set; }        public static string FunctionAllTemplate { get; private set; }        public static string FunctionAllSingleBlockTemplate { get; private set; }        public static string FunctionAllKeyBlockTemplate { get; private set; }        public static string FunctionAllGroupBlockTemplate { get; private set; }        public static string DisposeAllCfgsCacheTemplate { get; private set; }        public static string FunctionDisposeTemplate { get; private set; }        public static string StrCfgArrayDisposeTemplate { get; private set; }        public static string InitAllCfgsCacheTemplate { get; private set; }        public static string FunctionInitTemplate { get; private set; }        public static string StrCfgArrayInitTemplate { get; private set; }        //public static string ConfigTemplateEditor { get => _configTemplateEditor; }        //public static string ConfigArrayTemplateEditor { get => _configArrayTemplateEditor; }        public static void Init()        {            ConfigTemplate = File.ReadAllText(ExcelConfig.templatePath + "Config.txt");            //using (StreamReader sr = new StreamReader(ExcelConfig.templatePath + "Config.txt"))            //{            //    ConfigTemplate = sr.ReadToEnd();            //}            using (StreamReader sr = new StreamReader(ExcelConfig.templatePath + "ConfigArray.txt"))            {                ConfigArrayTemplate = sr.ReadToEnd();            }            using (StreamReader sr = new StreamReader(ExcelConfig.templatePath + "Init.txt"))            {                InitTemplate = sr.ReadToEnd();            }            using (StreamReader sr = new StreamReader(ExcelConfig.templatePath + "Dispose.txt"))            {                DisposeTemplate = sr.ReadToEnd();            }            using (StreamReader sr = new StreamReader(ExcelConfig.templatePath + "FunctionSingle.txt"))            {                FunctionSingleTemplate = sr.ReadToEnd();            }            using (StreamReader sr = new StreamReader(ExcelConfig.templatePath + "FunctionGroup.txt"))            {                FunctionGroupTemplate = sr.ReadToEnd();            }            using (StreamReader sr = new StreamReader(ExcelConfig.templatePath + "FunctionAll.txt"))            {                FunctionAllTemplate = sr.ReadToEnd();            }            using (StreamReader sr = new StreamReader(ExcelConfig.templatePath + "FunctionAllSingleBlock.txt"))            {                FunctionAllSingleBlockTemplate = sr.ReadToEnd();            }            using (StreamReader sr = new StreamReader(ExcelConfig.templatePath + "FunctionAllKeyBlock.txt"))            {                FunctionAllKeyBlockTemplate = sr.ReadToEnd();            }            using (StreamReader sr = new StreamReader(ExcelConfig.templatePath + "FunctionAllGroupBlock.txt"))            {                FunctionAllGroupBlockTemplate = sr.ReadToEnd();            }            using (StreamReader sr = new StreamReader(ExcelConfig.templatePath + "DisposeAllCfgsCache.txt"))            {                DisposeAllCfgsCacheTemplate = sr.ReadToEnd();            }            using (StreamReader sr = new StreamReader(ExcelConfig.templatePath + "FunctionDispose.txt"))            {                FunctionDisposeTemplate = sr.ReadToEnd();            }            using (StreamReader sr = new StreamReader(ExcelConfig.templatePath + "StrCfgArrayDisposeBlock.txt"))            {                StrCfgArrayDisposeTemplate = sr.ReadToEnd();            }            using (StreamReader sr = new StreamReader(ExcelConfig.templatePath + "InitAllCfgsCache.txt"))            {                InitAllCfgsCacheTemplate = sr.ReadToEnd();            }            using (StreamReader sr = new StreamReader(ExcelConfig.templatePath + "FunctionInit.txt"))            {                FunctionInitTemplate = sr.ReadToEnd();            }            using (StreamReader sr = new StreamReader(ExcelConfig.templatePath + "StrCfgArrayInitBlock.txt"))            {                StrCfgArrayInitTemplate = sr.ReadToEnd();            }        }    }}
 |