Best way to avoid allocations for updating Polyline points?
I searched through the forums here, but couldn't find any solution.
Is there any way to avoid allocations? I have 4 polylines (histograms in a zach-like, so relatively few points) that get refreshed every time a level is selected. Updating the points results in GenPolylineMesh allocating 19.2KB.
In total I'd have close to 200 polylines (50 levels x 4) so caching (at roughly 30K according to the profiler for a new) is workable, but not ideal. Histograms are static for the duration of the game.
Any other ways to reduce allocations/"garbage"?
apart from generating all of them once, there's not really a good fix apart from making the Shapes code not allocate. That said, I've done this for the next release, so it should be better down the line! (I don't know when the next update will go live though, we'll see!)