| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 | 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 ConstructorTemplate { 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 FunctionAllGroupBlockTemplate { 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 + "Constructor.txt"))            {                ConstructorTemplate = 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 + "FunctionAllGroupBlock.txt"))            {                FunctionAllGroupBlockTemplate = sr.ReadToEnd();            }        }    }}
 |