Hide
Expandable

Make serializable object expandable. (E.g. ScriptableObject, MonoBehavior)

Known issues:

  1. the Foldout will NOT be placed at the left space like a Unity's default foldout component, because Unity limited the PropertyDrawer to be drawn inside the rect Unity gives. Trying outside the rect will make the target non-interactable. But in early Unity (like 2019.1), Unity will force Foldout to be out of rect on top leve, but not on array/list level... so you may see different outcomes on different Unity version.

    If you see unexpected space or overlap between foldout and label, use Tools - Saints Field - Create or Edit SaintsField Config to change the config.

  2. ReadOnly (and DisableIf, EnableIf) can NOT disable the expanded fields. This is because InspectorElement does not work with SetEnable(false), neither with pickingMode=Ignore. This can not be fixed unless Unity fixes it.

  • Allow Multiple: No
using SaintsField; [Expandable] public ScriptableObject _scriptable;

expandable