Having a central ImmediateModeShapeDrawer
In the doc it says, "I recommend having only one central ImmediateModeShapeDrawer in your scene, then have that call functions in other objects, in order to have full control over draw order." which I didn't quite understand. Should I make a game object and reference each component in the scene that draws a shape and call its draw function? What is the best way to have a central ImmediateModeShapeDrawer?
Thank you 🙏
What is "best practice" really depends on how you want to structure your code, there's not really anything special about Shapes in this regard, so it's more of a general question about code structure that you'll have to decide for your project.
There are many approaches - you can have a type that adds itself to a list in the centralized drawer in OnEnable, and removes itself in OnDisable, if you want to draw everything from one place, but still have the actual drawing code in the objects themselves.
You can directly reference all the objects from the central manager, and nullcheck in case it might not exist, etc
Though keep in mind that sorting and draw order might not behave the way you expect with immediate mode, and sometimes it's more performant to use the components :)
As for tutorial videos, I don't have any out at the moment!
Thank you.