Making a minor change to Default inspector?

Hi, I have a multi-purpose class [handles all health and death related stuff] that has a bunch of variables that are only required should a bool be true,

e.g. if its not marked as an Exploder I don’t need the Explosion Radius or Explosion Damage properties

Is there any way to make a minor change [like toggling visibility] to the default inspector instead of having to write a complete inspector[which would require updating should the base class have variables added]

I’m thinking something like

override public void OnInspectorGUI()
	KillableObject me = target as KillableObject;
	if (!me.Exploder)

Thanks for any help

Well, you have the HideInInspector attribute, but that can’t be set on runtime. As far as I know you can’t do that without recurring to an Editor class. That’s what they are for, though.

Base class to derive custom Editors from. Use this to create your own custom inspectors and editors for your objects.

The OnInspectorGUI function of that class is called automatically when needed. For disabling things, maybe you will be interested in the Foldout widget.