using UnityEditor;
using UnityEngine;

[CustomPropertyDrawer(typeof(Inventory))]
public class InventoryDrawer : PropertyDrawer
{
	public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) {
		EditorGUI.BeginProperty(position, label, property);

		var countRect = new Rect(position.x + 120, position.y, 50, position.height);
		var ofRect = new Rect(position.x + 160, position.y, 30, position.height);
		var capacityRect = new Rect(position.x + 190, position.y, 50, position.height);

		EditorGUI.PropertyField(countRect, property.FindPropertyRelative("count"), GUIContent.none);
		EditorGUI.LabelField(ofRect, "of");
		EditorGUI.PropertyField(capacityRect, property.FindPropertyRelative("capacity"), GUIContent.none);
		EditorGUI.EndProperty();
	}
}
