public void Start()
    {
        List <string> values = MaskFieldAttribute.GetValues(Trees);

        for (int i = 0; i < values.Count; i++)
        {
            Debug.Log(values[i]);
        }
    }
Пример #2
0
    public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
    {
        MaskFieldAttribute mf = this.attribute as MaskFieldAttribute;

        if (mf == null)
        {
            return;
        }
        if (property.depth <= 0)
        {
            position.xMin += 4;
        }
        int mask = property.intValue;

        label.text = string.Format("{0}(0x{1:X})", mf.Lable, mask);
        mask       = EditorGUI.MaskField(position, label, mask, mf.DisplayedOptions);
        if (GUI.changed)
        {
            property.intValue = mask;
        }
    }