Custom objects from editor scripts?

Hey, folks!

So, I’ve got an object – called Cat, for example. And I want to display that in the Unity Inspector, with all its variables. Is there an easy way of doing this when you are also attempting to edit how the Inspector works? It seems to work quite easily when you’re just plugging them in with [System.Serializable], and not touching the inspector with an Editor script. But when you are, it seems you can’t just cause it to appear with its variables when you call object.FindProperty(“_catObject”);. Have you tried this? How does it work?

If in your InspectorGUI function you use “DrawDefaultInspector()”, that will do the default inspector for the object. You can “[HideInInspector]” any public variables you don’t want to show up in that, and it’ll draw the default inspector for your subclasses.