Selectable Gizmo With [DrawGizmo] as opposed to OnDrawGizmos

Is it possible to make a gizmo drawn through a function with the [DrawGizmo] Attribute (documented here) selectable in the same way a gizmo drawn through MonoBehaviour.OnDrawGizmos is selectable?
I only ask because, while functionally identical, I really like having my Editor and Game code completely separate, and this is one of the things preventing me from doing that.

Now I need one that rotates on its X Axis, but I'm not sure on how to that. Could you perhaps help me again?

1 Answer

1

Make sure to include GizmoType.Pickable.

[DrawGizmo(GizmoType.InSelectionHierarchy |
  GizmoType.NotInSelectionHierarchy | 
  GizmoType.Pickable)]
            static void DrawWhateverGizmos(MapInstaller scr, GizmoType gizmoType)

This seems to make all the gizmos drawn pick the game object.

Have you tried to attach the component twice, change the axis and the keys?