Class DrawingData
Helper for drawing Gizmos in a performant way.
This is a replacement for the Unity Gizmos class as that is not very performant when drawing very large amounts of geometry (for example a large grid graph). These gizmos can be persistent, so if the data does not change, the gizmos do not need to be updated.
How to use
Create a Hasher object and hash whatever data you will be using to draw the gizmos Could be for example the positions of the vertices or something. Just as long as if the gizmos should change, then the hash changes as well.
Check if a cached mesh exists for that hash
If not, then create a Builder object and call the drawing methods until you are done and then call Finalize with a reference to a gizmos class and the hash you calculated before.
Call gizmos.Draw with the hash.
When you are done with drawing gizmos for this frame, call gizmos.FinalizeDraw
Inner Types
Public Methods
Destroys all cached meshes.
Schedules the meshes for the specified hash to be drawn.
Schedules all meshes that were drawn the last frame with this redraw scope to be drawn again.
Get an empty builder for queuing drawing commands.
Get an empty builder for queuing drawing commands.
Get an empty builder for queuing drawing commands.
Call after all Draw commands for the frame have been done to draw everything.
Public Variables
Material to use for the navmesh outline in the editor.
Material to use for the navmesh in the editor.