- Home /
Question by
jakejolli · Aug 23, 2017 at 02:50 PM ·
c#inspectoreditor-scriptinginheritance
Custom ordering of variables in inspector when using base and derived classes
Example: I've got a base class Stats, and some derived classes EnemyStats and PlayerStats.
Stats has an XP variable, available to both classes. However, PlayerStats has an XPToNextLevel variable while EnemyStats doesn't.
Is there a way to customize the ordering of these variables in the inspector so that similar variables can be grouped together, regardless of whether or not they live in the base or derived class?
Comment
Best Answer
Answer by pslattery · Aug 23, 2017 at 04:58 PM
I think the only way to do this is to write a custom inspector for each derived class.
I was hoping for a simple attribute tag of some kind, but it looks like you might be right.