It’s a Constant battle trying to keep a project clean, but also iterable. Many years into my project and I have not found a clean, and reliable way to organize my exposed variables so that variables are hidden when not needed, and visible when they are.
Here are some things i’ve tried in my workflow, and why they are not optimal:
[HideInInspector]: Ok great, it’s not cluttering my UI any more, but the only way to reveal these variables ever again is to go into code, select the [HideInInspector] bit, and delete it. I would love if these were toggleable to be shown in debug mode, it would be the best of both worlds.
Tidy up my variables within classes: Sometimes I throw my variables into serialized classes so that I get a very easy to create rollout that is collapsible and easily hidden, but this just makes it very hard to reference these variables in code. Also when I shift my existing variables to a new format, I lose all the existing data associated with these variables.
Is there some sort of easy #region setting I don’t know about that would easily allow me to hide my variables in rollouts in the inspector?
I’m not looking to deep dive into learning how to make custom inspectors with code, I’m hoping someone knows some low level trick that’s easy to implement to help with ever expanding variable and information noise that would still allow me to tune these variables when needs be.
My dream solution would be a setting like [SuppressInInspector, 0], where the int would define the level of suppression as a weight. If we set suppression of the editor to -1, it would show all variables that are suppressed, but if set to 1 it would only show variables set to a rank 0 or 1 (defaults to 0). And this value could be easily set somewhere in the Unity UI. It would be so darned nice to be able to expose variables based on importance without constantly shuffling around [HideInInspector]'s everywhere.
Thanks in advance for any thoughts. I’ve been dealing with these issues for a long time and finally figured i’d make a post because you simply don’t know what you don’t know. I checked out this video:
And although it’s exciting to think of the possibilities, it’s a lot more overhead than I’m looking for. I’m seeking an easy means of sometimes showing variables, and sometimes not if I ever need to access them.