List all serialized properties in a custom inspector
I often find my self wanting to add a button or some other simple control to an inspector for a component that already exposes a lot of public properties. I'll show you how you can append controls to an inspector without having to write lots of code.
This is my test component:
To make the properties appear in a custom inspector, we could add them manually one by one, like this:
That will not scale well. What happens when you add a new property to MyComp? You have to add a bunch of lines to your inspector too. There is an easier way!
Check it out, yo! We iterated over the properties of the serialized object. And then we added a button. Whenever you add a new property to your component, your inspector will update as well.