How do I show a custom dynamic string instead of the script name of a MonoBehaviour component in the Inspector?

Hi everyone,

I’d like to replace the Labels with the script names with custom strings taken from a field inside a script MonoBehaviour.

I have a situation where several components from similar classes could be present on the same gameobject and this is rather confusing when inspecting them when inside a list of MonoBehaviours,
and when collapsing the scripts.

In short, in this image:

I’d like to show the contents of the Name field instead of the very first line “Action Show Overlay (Script)

I’ve seen people using or naming attributes I wasn’t aware of, such as [Display(FormatMethod = “FormatBehaviour”)], (Showing game object name instead of script name for script member variable in inspector · Issue #27 · vexe/VFW · GitHub) for which I can’t find any documentation for, so I was wondering if some hidden or obscure way to rename not just the first script component but each one in the image would be possible.

You should make all the actions SOs and then make on script to manage them all. That will tidy everything up.