[SerializeField] makes fields visible and editable in the inspector

I would like to make some private fields in my component serializable, however if I use the [SerializeField] attribute it also makes them visible and editiable in the inspector.

I guess could I could make a custom property drawer that displays nothing?

Is there a handier way of achieving what I want? (have a field in my component be serialzed but not be visible in the inspector)

Hi, add [HideInInspector] attribute as well (1):

[SerializeField][HideInInspector] private int width;

I hope that helps =D