I’d like to show a warning in the inspector like the Point Effector 2D does if there is no 2D Collider present on the same game object:

How to accomplish that?
I’d like to show a warning in the inspector like the Point Effector 2D does if there is no 2D Collider present on the same game object:

How to accomplish that?
You have to implement a custom inspector for your class and when you want to show such a warning you can use “EditorGUILayout.HelpBox” inside OnInspectorGUI. Something like that:
EditorGUILayout.HelpBox("Some warning text", MessageType.Warning);
It works like a sharm now and thanks for the hint with the RequireComponent attribute. I didn't know it, yet but I'll use it :).
– gyrosp