JetBrains Rider 2025.3 Help

Code inspection: Avoid 'base.OnGUI()' in classes derived from 'PropertyDrawer'

In Unity, PropertyDrawer is used to derive custom property drawers. When overriding the OnGUI method to provide custom drawing logic, calling base.OnGUI() is usually a mistake.

The base implementation of PropertyDrawer.OnGUI in Unity's source code simply draws a label saying "No GUI implemented". This is rarely what a developer intends when they are providing their own custom GUI implementation. Executing the base method can result in unnecessary UI elements or unexpected layout behavior.

This inspection flags calls to base.OnGUI() within an overridden OnGUI method of a class that inherits from UnityEditor.PropertyDrawer.

[CustomPropertyDrawer(typeof(MyData))] public class MyDrawer : PropertyDrawer { public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label) { base.OnGUI(pos, prop, label); // Custom drawing logic } }
[CustomPropertyDrawer(typeof(MyData))] public class MyDrawer : PropertyDrawer { public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label) { // Custom drawing logic } }
26 March 2026