Skip to content

Commit 95684b4

Browse files
committed
Fix overriding drawElementCallback in the ToolboxEditorList
1 parent 9e677d1 commit 95684b4

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

Assets/Editor Toolbox/Editor/Internal/ToolboxEditorList.cs

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ private void DrawElementRow(int index, bool isActive, bool isTarget, bool hasFoc
8282
var elementRect = elementGroup.rect;
8383
//adjust label width to the known dragging area
8484
EditorGUIUtility.labelWidth -= Style.dragAreaWidth;
85-
DrawElement(index);
85+
DrawElement(elementRect, index, isActive, hasFocus);
8686
EditorGUIUtility.labelWidth += Style.dragAreaWidth;
8787
}
8888

@@ -125,11 +125,18 @@ private void DrawElementDragHandle(Rect rect, int index, bool isSelected, bool h
125125
}
126126
}
127127

128-
private void DrawElement(int index)
128+
private void DrawElement(Rect rect, int index, bool isActive, bool hasFocus)
129129
{
130-
var element = List.GetArrayElementAtIndex(index);
131-
var content = GetElementContent(element, index);
132-
ToolboxEditorGui.DrawToolboxProperty(element, content);
130+
if (drawElementCallback != null)
131+
{
132+
drawElementCallback(rect, index, isActive, hasFocus);
133+
}
134+
else
135+
{
136+
var element = List.GetArrayElementAtIndex(index);
137+
var content = GetElementContent(element, index);
138+
ToolboxEditorGui.DrawToolboxProperty(element, content);
139+
}
133140
}
134141

135142
/// <summary>

0 commit comments

Comments
 (0)