Custom editor for Monobehaviour class containing classes

Hi,

Respect question in :

How could I do the same if the class inherit from Monobehaviour?

Regards,
Jordi

So what you want to do is have the abilities editable from the inspector of the thing that owns an array of them - that is really not normal behaviour - those abilities have their own editor on whichever GameObject they have been attached to.

You cannot have a thing derived from MonoBehaviour that isn’t attached to a GameObject using AddComponent. In other words you can’t just have an array of them standalone and you can’t create a new one with new SomeMonoBehaviourDerivedClass().

You can have the array and use it to hold references to the abilities stored on another game object, but you can’t just have them sitting around without being attached. In that case they should really be edited on the thing that they are attached to.