Hi
i want to use a System.Flags enum in a component. Also i wrote a custom editor.
This is the Enum.
[System.Flags]
public enum ConnectorGender {
Neutral = 1,
Female = 2,
Male = 4
}
The custom editor reads and writes the value with the following line of code
instance.compatibleGender = (ConnectorGender)EditorGUILayout.EnumMaskField("Genders", instance.compatibleGender);
However when I select a combination of values they are always wrong and when i select everything the value gets -1?
How can i fix this?
↧