Custom Inspector with field like Camera culling mask

I’m currently working on a custom inspector for one of my script.
I need to be able to select one or more layers (for some filters behaviour) and so I try to have a field exactly similar to the ‘Culling mask’ in the Camera inspector.
I tried with EditorGUILayout.EnumMaskField and EditorGUILayout.MaskField without any success despite the fact is apparently the class to use… If someone has some code example or a solution to this problem he will be welcome :slight_smile:

thanks in advance

My only other suggestion is to utilize the default drawing of the inspector for only that one field assuming it’s set as a LayerMask variable. Just add the HideInInspector directive to all the public variables you want to have custom editor fields for and do all your custom drawing. Then, at the end of the ongui stuff, add the drawdefaultinspector which will draw your default inspector stuff, essentially only drawing your layer field mask using the built-in method. Also awkward, but much easier to edit.

I implemented my inspector as you describe ([HideInInspector] + call to DrawDefaultInspector()) and it works as expected.
Thank you very much