Custom bitfield menus in the inspector

I notice that the LayerMask type, when used as a public member variable, shows as a special kind of popup menu in the inspector. Is it there any way I can make custom menus for my own bitfield types?

I’m looking at this because I’m considering the best way of describing to the AI which kind(s) of target it is and which kind(s) or target it likes to shoot at. A bitfield seems preferable to a set of booleans for this purpose, since it’s easier to apply a bitmask than to test a set of booleans against one another. However, it’s not such a good idea if I have to punch bits into the inspector in decimal!

I’m afraid not. The LayerMask popus were completely custom made for this particular bitfield (and the source of an unrealistic number of bugs. IIRC, they didn’t work proper from scripting until 1.5 or 1.6)…

Thanks for the insight. :slight_smile:

I’ll work something else out instead, like a serialisable custom class.