Esempio n. 1
0
        // 其他系统部分UI
        private void OtherSystems()
        {
            GUILayout.Space(_lineSpace);
            GUILayout.Label("其他系统部分", _itemTitle);
            GUILayout.Label("选择要生成的系统", _contentTitle);

            foreach (string systemName in ToolData.SystemInterfaceName)
            {
                ToolData.SystemSelectedState[systemName] = GUILayout.Toggle(ToolData.SystemSelectedState[systemName], systemName);
            }
            GUILayout.Space(_lineSpace);

            InputName("请输入脚本名称", ref ToolData.OtherSystemName);

            CreateButton("生成脚本", () =>
            {
                GenerateCode.CreateScript(ToolData.SystemPath + "/" + ToolData.SelectedContextName, ToolData.OtherSystemName + ToolData.SystemPostfix, CodeTemplate.GetOthersSystemCode());
                List <string> selectedSystem = CodeTemplate.GetSelectedSysytem();
                List <string> funName        = CodeTemplate.GetFunName(selectedSystem);
                GenerateCode.InitSystem(ToolData.SelectedContextName,
                                        ToolData.SelectedContextName + ToolData.OtherSystemName + ToolData.SystemPostfix,
                                        funName.ToArray());
                Close();
            });
        }
Esempio n. 2
0
        // View部分UI
        private void View()
        {
            GUILayout.Space(_lineSpace);
            GUILayout.Label("View层代码生成", _itemTitle);
            InputName("请输入脚本名称", ref ToolData.ViewName);

            CreateButton("生成脚本", () =>
            {
                GenerateCode.CreateScript(ToolData.ViewPath, ToolData.ViewName + ToolData.ViewPostfix, CodeTemplate.GetViewCode());
            });
        }
Esempio n. 3
0
        // Service部分UI
        private void Service()
        {
            GUILayout.Space(_lineSpace);
            GUILayout.Label("Service层代码生成", _itemTitle);

            InputName("请输入脚本名称", ref ToolData.ServiceName);

            CreateButton("生成脚本", () =>
            {
                GenerateCode.CreateScript(ToolData.ServicePath, ToolData.ServiceName + ToolData.ServicePostfix, CodeTemplate.GetServiceCode());
                GenerateCode.InitServices(ToolData.ServiceManagerPath);
                Close();
            });
        }
Esempio n. 4
0
        // 响应系统部分UI
        private void ReactiveSystem()
        {
            GUILayout.Space(_lineSpace);
            GUILayout.Label("响应系统部分", _itemTitle);

            InputName("请输入脚本名称", ref ToolData.ReactiveSystemName);

            CreateButton("生成脚本", () =>
            {
                GenerateCode.CreateScript(ToolData.SystemPath + "/" + ToolData.SelectedContextName, ToolData.ReactiveSystemName + ToolData.SystemPostfix, CodeTemplate.GetReactiveSystemCode());
                GenerateCode.InitSystem(ToolData.SelectedContextName,
                                        ToolData.SelectedContextName + ToolData.ReactiveSystemName + ToolData.SystemPostfix,
                                        "ReactiveSystem");
                Close();
            });
        }