Only show vars in inspector if check box is checked.

I need to make it so if I check a boolean in the inspector it shows other vars in the inspector. And if its not then dont show them.

Also posted to forums, here: http://forum.unity3d.com/threads/82474-Only-show-vars-in-Inspector-if-Boolean-is-Checked

Not from the box, but it should be easy to inherit from MonoBehaviour and add an event that fires on Awake.

3 Answers

3

Take a look at this function OnInspectorUpdate.

Hope this is a starting point …

That is what this does, except that instead of disabling the default inspector, just don't draw it at all.

This isn't really a question more a statement. Try giving it a go then posting the problems your having with it.