Hi,
I made a custom Drawer of a class (Item). And another class containing a list of those items (ItemList).
The inspector show this:
But when expanding some element, the others get fadded out:
This is a minimal reproducible example (deleting the CustomPropertyDrawer makes it work though, but deleting the Drawer is not an option in my production code).
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
#endif
public class ItemList : MonoBehaviour
{
public Item[] ListOfPointLists;
}
[System.Serializable]
public class Item
{
public int name;
}
#if UNITY_EDITOR
[CustomPropertyDrawer(typeof(Item))]
public class ItemDrawer : PropertyDrawer
{
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
EditorGUI.BeginProperty(position, label, property);
EditorGUI.PropertyField(position, property, label, true);
EditorGUI.EndProperty();
}
public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
{
float height = EditorGUI.GetPropertyHeight(property, label, true);
return height;
}
}
#endif
Thanks for considering my request.