//------------------------------------------------------------------------- _InitProjectInfo _drowInitProjectWindow(_InitProjectInfo project_info) { _InitProjectInfo project_infoex = new _InitProjectInfo(); project_infoex.cloneData(project_info); string company_name_title = "公司名:"; string app_name_title = "App名:"; string bundle_identify_title = "BundleIdentify:"; if (project_infoex.IsDefault) { company_name_title = "默认公司名:"; app_name_title = "默认App名:"; bundle_identify_title = "默认BundleIdentify:"; } EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField(company_name_title); project_infoex.CompanyName = EditorGUILayout.TextField(project_infoex.CompanyName); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField(app_name_title); project_infoex.AppName = EditorGUILayout.TextField(project_infoex.AppName); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField(bundle_identify_title); project_infoex.BundleIdentify = EditorGUILayout.TextField(project_infoex.BundleIdentify); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("初始程序版本号(请以*.**.***,其中*为数字来设置):"); project_infoex.InitBundleVersion = EditorGUILayout.TextField(project_infoex.InitBundleVersion); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("初始资源版本号(请以*.**.***,其中*为数字来设置):"); project_infoex.InitDataVersion = EditorGUILayout.TextField(project_infoex.InitDataVersion); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("项目名:"); project_infoex.ProjectSourceFolderName = EditorGUILayout.TextField(project_infoex.ProjectSourceFolderName); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("==================华丽的分割线=================="); EditorGUILayout.EndHorizontal(); return(project_infoex); }
//------------------------------------------------------------------------- void OnGUI() { if (mCanStartInitProjectDetail) { MapChangeInitProjectInfo.Clear(); foreach (var i in MapInitProjectInfo) { var project_info = _drowInitProjectWindow(i.Value); MapChangeInitProjectInfo[project_info.ProjectIndex] = project_info; } foreach (var i in MapChangeInitProjectInfo) { _InitProjectInfo project_info = null; MapInitProjectInfo.TryGetValue(i.Key, out project_info); if (project_info != null) { project_info.cloneData(i.Value); } } bool init = GUILayout.Button("设置", GUILayout.Width(200)); if (init) { bool is_initall = true; foreach (var i in MapInitProjectInfo) { if (!i.Value.isAllInit()) { is_initall = false; } } if (is_initall) { _initProject(); ShowNotification(new GUIContent("初始化成功!")); } } } else { EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("初始化项目个数:"); int.TryParse(EditorGUILayout.TextField(mInitProjectNum.ToString()), out mInitProjectNum); EditorGUILayout.EndHorizontal(); bool confirm_num = GUILayout.Button("确定", GUILayout.Width(200)); if (confirm_num) { if (mInitProjectNum != 0) { for (int i = 0; i < mInitProjectNum; i++) { bool is_default = false; if (i == 0) { is_default = true; } _InitProjectInfo init_info = new _InitProjectInfo(); init_info.ProjectIndex = i; init_info.IsDefault = is_default; MapInitProjectInfo[init_info.ProjectIndex] = init_info; } mCanStartInitProjectDetail = true; } } } }