Created
February 15, 2014 05:33
-
-
Save ChemiKhazi/9014977 to your computer and use it in GitHub Desktop.
Unity3D Enum Flags PropertyDrawer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[CustomPropertyDrawer(typeof(EnumType))] | |
public class PlayerUnitDrawer : PropertyDrawer | |
{ | |
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) | |
{ | |
EditorGUI.BeginProperty(position, label, property); | |
property.intValue = (int) (EnumType) EditorGUI.EnumMaskField(position, "Property Name", (EnumType)property.intValue); | |
EditorGUI.EndProperty(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment