| | |
| | | } |
| | | } |
| | | |
| | | public static void CreateConfigClass(FileInfo fileInfo) |
| | | public static void CreateConfigClass(FileInfo fileInfo, bool isIL = false) |
| | | { |
| | | var lines = File.ReadAllLines(fileInfo.FullName); |
| | | if (lines.Length > 2) |
| | |
| | | |
| | | filedContent = string.Join("\r\n\t", fieldFulls.ToArray()); |
| | | readContent = string.Join("\r\n\r\n\t\t\t", readFulls.ToArray()); |
| | | CreatNewConfigClass(fileInfo.Name.Substring(0, fileInfo.Name.IndexOf('.'))); |
| | | CreatNewConfigClass(fileInfo.Name.Substring(0, fileInfo.Name.IndexOf('.')), isIL); |
| | | } |
| | | |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | static string configClassPath = "Assets" + "/" + "Scripts/Core/GameEngine/Model/Config"; |
| | | static string configClassPath = "Assets/Scripts/Core/GameEngine/Model/Config"; |
| | | static string configILClassPath = "LogicProject/Src/Config"; |
| | | static string templatePath = "Assets/Editor/ScriptTemplate/ConfigDataTemplate.txt"; |
| | | |
| | | public static void CreatNewConfigClass(string _name) |
| | | public static void CreatNewConfigClass(string _name, bool isIL) |
| | | { |
| | | var newConfigPath = configClassPath + string.Format("/{0}Config.cs", _name); |
| | | string newConfigPath; |
| | | if (isIL) |
| | | { |
| | | newConfigPath = configILClassPath + string.Format("/IL{0}Config.cs", _name); |
| | | } |
| | | else |
| | | { |
| | | newConfigPath = configClassPath + string.Format("/{0}Config.cs", _name); |
| | | } |
| | | AssetDatabase.DeleteAsset(newConfigPath); |
| | | UnityEngine.Object o = CreateScriptAssetFromTemplate(newConfigPath, templatePath); |
| | | ProjectWindowUtil.ShowCreatedAsset(o); |