For example, in C++ I would have:
And I would imagine an editor would work like a list of booleans, or an enum dropdown with checks for which values are present.
Thanks for the help
asked Sep 28 '10 at 06:15 PM
An enum works just like that.
In the inspector, the variable blah has a drop-down of values from the enum foo.
To allow for multiple simultaneous selections is a bit trickier. That requires something that will generate an IntPopUp. One of the things that gets in the way is that .Net doesn't implicitly treat ints as enum types (and vice versa) and another is that Unity's inspector doesn't seem to do anything special with the System.FlagsAttribute as near as I can tell.
I'm still digging to find a way to serialize something in generic other than a LayerMask which generates an IntPopUp. As it stands, the only way that I can see is to create a CustomEditor for scripts and a custom class of integer or enum for which your CustomEditor will generate an IntPopUp. Please see these scripts for an idea of how to get started on that.