private void Draw_SVNUpdate() { bool bChanged = false; m_stkRm.Clear(); GUILayout.BeginVertical(EditorStyles.objectFieldThumb); for (int i = 0; i < m_lsUpdatePath.Count; ++i) { string s = m_lsUpdatePath[i].m_sPath; GUILayout.BeginVertical(EditorStyles.objectFieldThumb); GUILayout.BeginHorizontal(); ATGUILib.ChangeableButton("更新", !string.IsNullOrEmpty(m_lsUpdatePath[i].m_sPath), a => SVNUpdate((string)a), m_lsUpdatePath[i].m_sPath, 40); EditorGUI.BeginChangeCheck(); GUI.contentColor = ATGUILib.EnhanceColor(Color.green); m_lsUpdatePath[i].m_sDescribe = EditorGUILayout.TextField(m_lsUpdatePath[i].m_sDescribe); GUI.contentColor = Color.white; if (EditorGUI.EndChangeCheck()) { bChanged = true; } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); if (ATGUILib.PathBar("更新目录", ATHelper_File.CorrectPath(ATDefine.Path_Project + "/.."), ref s, "", 190, true, false)) { m_lsUpdatePath[i].m_sPath = s; bChanged = true; } if (GUILayout.Button("-", EditorStyles.miniButton)) { bChanged = true; m_stkRm.Push(i); } GUILayout.EndHorizontal(); GUILayout.EndVertical(); GUILayout.Space(5); } for (int i = 0; i < m_stkRm.Count; ++i) { m_lsUpdatePath.RemoveAt(m_stkRm.Pop()); } if (bChanged) { SetConfig <string>(c_sConfig_UpdatePath, CombinePath(m_lsUpdatePath)); } GUILayout.Space(10); if (GUILayout.Button("新增地址")) { m_lsUpdatePath.Add(new PathDescribe("", "---设置更新目录备注---")); } GUILayout.EndVertical(); EditorGUILayout.TextArea(sInfo); }
public override void OnGUI() { if (string.IsNullOrEmpty(Path_Unity) || !new DirectoryInfo(Path_Assemblies).Exists) { string sPath = ""; if (ATGUILib.PathBar("设置Unity路径", "", ref sPath, "", 130, true)) { if (sPath.EndsWith("Editor")) { Path_Assemblies = ATHelper_File.CorrectPath(Path.Combine(sPath, InnerPath_Managed)); if (new DirectoryInfo(Path_Assemblies).Exists) { Path_Unity = sPath; SetConfig <string>(Config_UnityPath, sPath); } else { Path_Assemblies = ""; } } } return; } GUI.backgroundColor = ATGUILib.EnhanceColor(ATGUILib.LightBlue); EditorGUI.BeginChangeCheck(); m_sInfo = EditorGUILayout.TextArea(m_sInfo, GUILayout.Height(400)); GUI.backgroundColor = Color.white; if (EditorGUI.EndChangeCheck()) { m_kCompileResult = null; } GUILayout.Space(10); EditorGUILayout.TextArea(GetInfo(), GUILayout.Height(200)); GUILayout.Space(10); GUILayout.BeginHorizontal(); ATGUILib.ChangeableButton("编译", m_kCompileResult == null, Complile); ATGUILib.ChangeableButton("运行", m_kCompileResult != null && !m_kCompileResult.Errors.HasErrors, Run); GUILayout.EndHorizontal(); }