public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
        {
            if (INVENTORY == null)
            {
                INVENTORY = DatabaseInventory.Load();
            }

            property.intValue = EditorGUI.MaskField(
                position,
                label,
                property.intValue,
                INVENTORY.GetItemTypesIDs()
                );
        }
示例#2
0
        public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
        {
            if (INVENTORY == null)
            {
                INVENTORY = DatabaseInventory.Load();
            }

            string[] ids    = INVENTORY.GetItemTypesIDs();
            int[]    values = new int[ids.Length];
            for (int i = 0; i < values.Length; ++i)
            {
                values[i] = i;
            }

            property.intValue = EditorGUI.IntPopup(
                position,
                label.text,
                property.intValue,
                ids,
                values
                );
        }