Draw Handles in front of Gizmos?

Is there a simple way to get Handles to display in font of Gizmos when drawing to the Scene View in Unity editor? I guess the more specific question is that I’d like the Gizmos to draw first, instead of the Handles drawin first, since niether uses the Z-buffer.

For example, here I am drawing a cube with Gizmos.DrawCube, but a label with Handles.Label, and the label appears behind the cube. Both are done in the same function (an OnDrawGizmos() callback), and the order in which I invoke the two functions does not matter. I can call Gizmos first or Handles first but it will always end up looking the same.

8986057--1236871--upload_2023-5-1_21-17-47.png

Bump

Not sure if this can be done directly in a MonoBehaviour inside OnDrawGizmos. But this can be done using a custom Editor inside OnSceneGUI.

public void OnSceneGUI()
{
    // Handles behind gizmos

    // Draws gizmos defined in MonoBehaviour's OnDrawGizmos
    Handles.DrawGizmos(SceneView.lastActiveSceneView.camera);

    // Handles in front of gizmos
}

Hope that helps!

Bump