1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- 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 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 + "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();
- }
- }
- }
- }
|