| | |
| | | newConfigPath = configClassPath + string.Format("/{0}Config.cs", _name); |
| | | } |
| | | AssetDatabase.DeleteAsset(newConfigPath); |
| | | UnityEngine.Object o = CreateScriptAssetFromTemplate(newConfigPath, templatePath); |
| | | UnityEngine.Object o = CreateScriptAssetFromTemplate(newConfigPath, templatePath, isIL); |
| | | ProjectWindowUtil.ShowCreatedAsset(o); |
| | | } |
| | | |
| | | internal static UnityEngine.Object CreateScriptAssetFromTemplate(string pathName, string resourceFile) |
| | | internal static UnityEngine.Object CreateScriptAssetFromTemplate(string pathName, string resourceFile, bool isIL) |
| | | { |
| | | string fullPath = Path.GetFullPath(pathName); |
| | | |
| | |
| | | text = Regex.Replace(text, "#DateTime#", System.DateTime.Now.ToLongDateString()); |
| | | text = Regex.Replace(text, "#Field#", CreateConfigClassFile.filedContent); |
| | | text = Regex.Replace(text, "#Read#", CreateConfigClassFile.readContent); |
| | | text = Regex.Replace(text, "#FileName#", fileNameWithoutExtension.Substring(0, fileNameWithoutExtension.Length - 6)); |
| | | if (isIL) |
| | | { |
| | | text = Regex.Replace(text, "#FileName#", fileNameWithoutExtension.Substring(2, fileNameWithoutExtension.Length - 8)); |
| | | } |
| | | else |
| | | { |
| | | text = Regex.Replace(text, "#FileName#", fileNameWithoutExtension.Substring(0, fileNameWithoutExtension.Length - 6)); |
| | | } |
| | | |
| | | bool encoderShouldEmitUTF8Identifier = true; |
| | | bool throwOnInvalidBytes = false; |