/// <summary>自动创建UI脚本</summary> private static void CreateUICSharpScript() { UIConfigDatabase uIConfigInfo = new UIConfigDatabase(); uIConfigInfo.Load(); foreach (UIConfigData info in uIConfigInfo.GetAllDataList()) { string dataName = UIDefine.UIFormCSharpScriptsPath + info.Name + ".cs"; if (!File.Exists(dataName)) { string template = GetTemplate(UIDefine.Template_UIFORM_CSHARP_BASE); template = template.Replace("$classNote", info.Des); template = template.Replace("$className", info.Name); template = template.Replace("$messageType", info.Name + "Event"); GenerateScript(dataName, template); } } }
/// <summary>创建UI窗口</summary> private static void CreateUIFormNames() { string template = GetTemplate(UIDefine.Template_UIFORM_NAMES); string uiFormNameLiset = null; string uiuiFormNameType = null; UIConfigDatabase uIConfigInfo = new UIConfigDatabase(); uIConfigInfo.Load(); foreach (UIConfigData info in uIConfigInfo.GetAllDataList()) { uiFormNameLiset += SpliceFormName(info.Name, info.Des) + "\n"; uiuiFormNameType += SpliceFormType(info.Name, info.Des) + "\n"; } template = template.Replace("$UIAttributes", uiFormNameLiset); template = template.Replace("$UIType", uiuiFormNameType); string dataName = ConfigDefine.GENERATE_SCRIPT_PATH + "/" + "UIFormNames.cs"; GenerateScript(dataName, template); }