Base MonoBehaviour Editor, foldout with base properties, child properties untouched.

Hello, I would like to try and create a base class that all my MonoBehaviours can inherit from, where I can control stuff like logging options etc. How ever, I dont want to clutter up my serialized variables in my editor most of the time. So I want to add a foldout using a CustomEditor. I have set it up to override the OnInspectorGUI() method. But what I struggle to figure out is, how do I do the following?

BaseBehaviour : MonoBehaviour
[SerializedField] bool showLogs;

TestBehaviour : BaseBehaviour
[SerializedField] bool testBool;

And then have the editor script for the BaseBehaviour draw out…

if (foldout) {
    DrawAllFieldsInBaseBehaviour (aka showLogs, in this case)
DrawAllFieldsInInheritedBehaviour (like default, but EXCLUDING. showLogs)

To clearify, I need help to write these two Draw methods above. If at all possible, I don’t know a lot about how serialization works, so I might not even be able to say DrawAllFieldsInInheritedBehaviour

After some more searches, I did stumble upon some useful functions. So I now have access to all the serialized fields. Using:

SerializedProperty property = serializedObject.GetIterator();
while (property.NextVisible(true))
    Debug.Log("Prop: " +;

I get both showLogs AND testBool. And I can draw the remaining properties using:

DrawPropertiesExcluding(serializedObject, excludedProperties.ToArray());

So now I actually only need a way to determine that only showLogs belongs in the BaseBehaviour class!