Component based Inspector drawer

chrisk

Active member
Adding a new field means that I have to add a new field in the corresponding *Inspector.cs

This is really tedious as you have to do it for all fields in order for it to show up in the inspector.

I think the better approach is to use a component-based drawer like Odin.

You define drawer for each component type and you don't have to anything in the *Inspector.cs

This can save quite a lot of time and prevent some fields not showing up in the Inspector.
 
There are positives and negatives towards both approaches and I've found that using the fully-fledged editor inspector leads to a lot more flexibility. It does have the downside of needing to ensure the fields are added but once you get in the habit it ends up not being an issue.
 
Sure, you may have the full control at the cost of manual work listing all variables. To me, it's really tedious that I have to create a separate Inspector class for all my classes and to list all new variables.

With the component-based system, you still have the full control of how to render each type. You don't need to create a new Inspector class and you can organize them in the original class.

This makes working much easier too because you have to work in one file instead of the two. Now, to search the variable, I have to go to the Inspector class to make sure the variable name matches. To me, the advantage/disadvantages are clear.

Even if you have more control, like reordering stuff, most of us don't need it as long as there is a component that can render nicely in the inspector and we can still reorder stuff. It also explains why Odin so popular.

I wish you make it a little easier for users to extend the system. Most of the classes are not extensible without modifying the core code cause many variables are private and methods are non-virtual. I have to keep patching stuff whenever I get an update.
It's not fun but I can live with but making component-based is something I cannot do. You don't have to convert them all at once but incrementally with each update
 
Top