Skip to content
Matt Ellis edited this page Mar 26, 2018 · 12 revisions

Code Inspections

Unity support ships with several inspections designed to help you find issues with your code before you run it. The following pages provide more details about why Rider or ReSharper is showing a particular inspection.

Note that these pages can be navigated to from the Alt+Enter menu, under the "Inspection: …" sub menu, there will be a menu item "Why is Rider suggesting this?" or "Why is ReSharper suggesting this?". Selecting this item will navigate to the appropriate page in the list below.

Inspection Default severity
Attribute is redundant when applied to this declaration type Dead code
MonoBehaviors must be instantiated with GameObject.AddComponent instead of new Warning
Possible unintended bypass of lifetime check of underlying Unity engine object Warning
Redundant InitializeOnLoad attribute Warning
Redundant SerializeField attribute Dead code
Redundant Unity event function Dead code
ScriptableObjects must be instantiated with ScriptableObject.CreateInstance instead of new Warning
Use CompareTag instead of explicit string comparison Warning
Clone this wiki locally