private void InitState() { dicUIFormState.Clear(); for (int i = 0; i < uIConfig.GetCount(); i++) { UIConfigData uiInfo = uIConfig.GetAllData()[i]; if (!dicUIFormState.ContainsKey(uiInfo.Name)) { ChangeUIFormState(uiInfo.Name, UIFormState.None); } } }
/// <summary>自动创建UI脚本</summary> private static void CreateUICSharpScript() { UIConfigDatabase uIConfigInfo = new UIConfigDatabase(); uIConfigInfo.Load(); foreach (UIConfigData info in uIConfigInfo.GetAllData()) { 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 + "Msg"); GenerateScript(info.Name, 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.GetAllData()) { uiFormNameLiset += SpliceFormName(info.Name, info.Des) + "\n"; uiuiFormNameType += SpliceFormType(info.Name, info.Des) + "\n"; } template = template.Replace("$UIAttributes", uiFormNameLiset); template = template.Replace("$UIType", uiuiFormNameType); GenerateScript("UIFormNames", template); }