1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- 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()
- {
- 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();
- }
- }
- }
- }
|