I know the ObjectField of Unity only shows the name of the GameObject. This could be confusing when the reference is link to a specific component on the GO. Especially when I'm editing a list of SerializedActions.
So I managed to draw the name of the referenced component on the ObjectFied of SerializedAction by adding code below to line 99 in BaseSerializationDelegateEditor.cs.
if(element.MethodContainer)
{
// Draw the refenreced component on the ObjectField
Vector2 size = EditorStyles.objectField.CalcSize(new GUIContent(element.MethodContainer.name));
objectRect.x += size.x - 8f;
objectRect.width -= size.x + 10f;
GUI.Label(objectRect, "->" + element.MethodContainer.GetType());
}
Result is like this,
It's pretty hacking and hardcoding but it works. Maybe you want to refine it and apply it to all ObjectField by making a wrap function of ObjectField().
I know the ObjectField of Unity only shows the name of the GameObject. This could be confusing when the reference is link to a specific component on the GO. Especially when I'm editing a list of SerializedActions.
So I managed to draw the name of the referenced component on the ObjectFied of SerializedAction by adding code below to line 99 in BaseSerializationDelegateEditor.cs.
Result is like this,
It's pretty hacking and hardcoding but it works. Maybe you want to refine it and apply it to all ObjectField by making a wrap function of ObjectField().