Skip to content

Redundant SerializeField attribute

Matt Ellis edited this page Mar 27, 2018 · 7 revisions

If a field has both [SerializeField] and [NonSerialized] attributes, the [NonSeralized] attribute takes precedence and Unity will ignore the [SerializeField] attribute.

This inspection will highlight the [SerializeField] attribute as redundant if both attributes are specified. It also provides an Alt+Enter quick fix to remove the redundant attribute.

See also the Unity documentation on SerializeField.

Clone this wiki locally