| | |
| | | { |
| | | return StringUtility.Contact("int.TryParse(tables", "[", index, "]", ",", "out ", field, ")", "; "); |
| | | } |
| | | else if (type.Contains("long")) |
| | | { |
| | | return StringUtility.Contact("long.TryParse(tables", "[", index, "]", ",", "out ", field, ")", "; "); |
| | | } |
| | | else if (type.Contains("float")) |
| | | { |
| | | return StringUtility.Contact("float.TryParse(tables", "[", index, "]", ",", "out ", field, ")", "; "); |
| | |
| | | var newConfigPath = configClassPath + string.Format("/{0}Config.cs", _name); |
| | | AssetDatabase.DeleteAsset(newConfigPath); |
| | | UnityEngine.Object o = CreateScriptAssetFromTemplate(newConfigPath, templatePath); |
| | | AddConfigInit(newConfigPath); |
| | | ProjectWindowUtil.ShowCreatedAsset(o); |
| | | } |
| | | |
| | |
| | | internal static void AddConfigInit(string pathName) |
| | | { |
| | | string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(pathName); |
| | | string add1 = string.Format("{0}.Init();{1}", fileNameWithoutExtension, "\r\n\t\ttaskCount++;"); |
| | | string add1 = string.Format("{0}.Init();taskCount++;", fileNameWithoutExtension); |
| | | string add2 = string.Format("completeCount += {0}.inited ? 1 : 0;", fileNameWithoutExtension); |
| | | |
| | | string path = Application.dataPath + "/Scripts/Utility/ConfigInitiator.cs"; |
| | |
| | | { |
| | | text = text.Replace("//初始化结束\r\n", add1 + "\r\n" + "\t\t//初始化结束\r\n"); |
| | | } |
| | | else |
| | | { |
| | | Debug.Log(fileNameWithoutExtension); |
| | | } |
| | | |
| | | if (!text.Contains(add2)) |
| | | { |