I wanted the ability add custom types to a list on a scriptable object asset within the inspector. These types extend a common base and are
standard C# classes. Normally Unity doesn't know about your standard C# classes unless you create a reference for each type or create
some complex custom editor solution. Manually adding the types to the list will result in a Type Mismatch
within the inspector. There are
all sorts of use cases for this such as custom properties, creating an editor friendly strategy pattern system, etc. However, not being
able to edit the fields is a real pain in the ass.
Fortunately unity provides two super useful attributes: [SerializeReference]
and [ContextMenu]
.
Example: