123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- 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 FunctionGroupTemplate { get; private set; }
- public static string FunctionGroupOnlyTemplate { get; private set; }
- public static string FunctionSingleTemplate { 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 + "FunctionGroup.txt"))
- {
- FunctionGroupTemplate = sr.ReadToEnd();
- }
- using (StreamReader sr = new StreamReader(ExcelConfig.templatePath + "FunctionGroupOnly.txt"))
- {
- FunctionGroupOnlyTemplate = sr.ReadToEnd();
- }
- using (StreamReader sr = new StreamReader(ExcelConfig.templatePath + "FunctionSingle.txt"))
- {
- FunctionSingleTemplate = sr.ReadToEnd();
- }
- }
- }
- }
|