public void LeftPanel(float width) { Rect panelRect = EditorGUILayout.BeginVertical(); GUILayout.Space(2); EditorGUILayout.BeginHorizontal(); if (GUILayout.Button("Select All", GUILayout.Height(14))) { selectionChanged = true; selection.Clear(); for (int i = 0; i < VPaint.Instance.objectInfo.Length; i++) { selection.Add(i); } } if (GUILayout.Button("Deselect All", GUILayout.Height(14))) { selectionChanged = true; selection.Clear(); } if (VPaintGUIUtility.FoldoutMenu()) { var menu = new GenericMenu(); foreach (var type in VPaint.Instance.errorTypes) { VPaintObjectError error = type; menu.AddItem(new GUIContent("Select Errors/" + Enum.GetName(typeof(VPaintObjectError), error)), false, () => { for (int i = 0; i < VPaint.Instance.objectInfo.Length; i++) { var info = VPaint.Instance.objectInfo[i]; if (info.errors.Contains(error)) { if (!selection.Contains(i)) { selection.Add(i); } } } }); } menu.ShowAsContext(); } EditorGUILayout.EndHorizontal(); leftPanelScroll = EditorGUILayout.BeginScrollView(leftPanelScroll); for (int i = 0; i < VPaint.Instance.objectInfo.Length; i++) { var info = VPaint.Instance.objectInfo[i]; if (showOnlyErrors) { if (!info.error) { selection.Remove(i); continue; } } Rect r = EditorGUILayout.BeginHorizontal(); r.height += 2; int boxCount = 0; if (selection.Contains(i)) { boxCount = 1; } for (int b = 0; b < boxCount; b++) { GUI.Box(r, GUIContent.none); } if (Event.current.type == EventType.MouseDown && Event.current.button == 0 && r.Contains(Event.current.mousePosition)) { if (!Event.current.shift && !Event.current.control) { selection.Clear(); } if (!selection.Contains(i)) { selection.Add(i); selectionChanged = true; } else if (!Event.current.shift && Event.current.control) { selection.Remove(i); selectionChanged = true; } Event.current.Use(); } GUIStyle labelStyle = new GUIStyle(GUI.skin.label); if (info.error) { labelStyle.normal.textColor = Color.red; } GUILayout.Label(info.Name, labelStyle); GUILayout.FlexibleSpace(); string errorLog = info.errorLog; if (errorLog != "") { errorLog = "[" + errorLog + "]"; } GUILayout.Label(errorLog, labelStyle); EditorGUILayout.EndHorizontal(); GUILayout.Space(2); } EditorGUILayout.EndScrollView(); if (Event.current.type == EventType.MouseDown && Event.current.button == 0 && panelRect.Contains(Event.current.mousePosition)) { if (!Event.current.shift) { selection.Clear(); selectionChanged = true; Event.current.Use(); } } EditorGUILayout.EndVertical(); }