Draw order of Immediate-Mode is very strange.
For multiply GameObject with Custom Shape(use Immediate-Mode Drawing), It seems draw order is not base on hierarchy, but is base on order of creation.
If I create GameObject like:
go1
go2
go3
then draw order is:
go3
go2
go1
and then,no matter how you change the order in hieracrchy,the draw order is not changed.
My temporary solution is to create gameObjects based on the drawing order.
Bbut, is there a better way.
It that possible by use Draw.Ztest? Can you give a concrete example?
I've added some more detail now to the documentation on this to clarify how it works!
The ImmediateModeShapeDrawer component will subscribe to Unity's beginCameraRendering event in OnEnable
Rread more here: https://www.acegikmo.com/shapes/docs/#draw-order