Can I put the 'OnDrawGizmos' code in the CustomEditor?

Since the Editor for my behavoir doesn’t inherit from MonoBehvior, it doesn’t have an OnDrawGizmos or OnDrawGizmosSelected method.

I would like to keep all the editor and debug code in the Editor, first of all to keep things organized, but also so it doesn’t get compiled when I build the final release. Is there any way to respond to “GizmosSelected” from the Editor instead of the MonoBehavior, without the behavior needing to keep a reference to the editor all the time?

You can use Draw Gizmo attribute. Unity - Scripting API: DrawGizmo