(I posted this question in the forums, but I think it doesn’t have such visibility as here).
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 faded 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 ListOfItems;
}
[System.Serializable]
public class Item
{
public string _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.