private void OnDrawBackground(Rect rect, int index, bool isActive, bool isSelected) { if (isSelected) { GUIExtensions.ColouredBox(rect, GUI.skin.settings.selectionColor, ZPCommonResources.SimpleSolidBackground); return; } GUIExtensions.ColouredBox(rect, ZPCommonResources.GetElementBgColor(index, EditorGUIUtility.isProSkin), ZPCommonResources.SimpleSolidBackground); }
/// <summary> /// Handles drawing the background before applying the element on top /// </summary> /// <param name="rect">The rectangle to render the variable in</param> /// <param name="index">The index of the property</param> /// <param name="isActive">True if the element is active, false if not</param> /// <param name="isSelected">True if the element is selected, false if not</param> private void DrawBackground(Rect rect, int index, bool isActive, bool isSelected) { int finalIndex = index; if (HasFilterString()) { filterIndices.TryGetValue(index, out finalIndex); } Color color = ZPCommonResources.GetElementBgColor(finalIndex, EditorGUIUtility.isProSkin); if (isSelected) { color = GUI.skin.settings.selectionColor; } GUIExtensions.ColouredBox(rect, color, ZPCommonResources.SimpleSolidBackground); }