Quantcast
Channel: Latest Questions by weltraumaffe
Viewing all articles
Browse latest Browse all 12

Enum Flags not working (selecting wrong value)

$
0
0
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?

Viewing all articles
Browse latest Browse all 12

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>