Hi Nate,
Was hunting down some garbage SkeletonRenderer.cs was generating and think I have identified and fixed a small issue.
Currently at the Setup Mesh Stage (line 201) you do:
float[] tempVertices = this.tempVertices;
with this.tempVertices initially being set to a size of 8 for RegionAttachments.
However, for meshes you re-allocate as necessary to accomodate their (mostly larger) vertice length. I noticed though that you re-allocate the local copy and not the global copy.
Changing the lines 246 and 267 from
tempVertices = new float[meshVertexCount];
to
this.tempVertices = tempVertices = new float[meshVertexCount];
or something along those lines updates the global array too and solves the issue, which results in 0 bytes of garbage for me now once the skeleton has been around for a while and displayed all potential meshes/triangles etc.
I imagine for others with a lot of meshes and vertices this was probably generating quite some garbage over time. Hope you can update the source accordingly. Anyway, pretty simple bug that just slipped under the radar.
Cheers, Rob 🙂
P.s. Maybe also get rid of the global private variable mesh, as at the moment you only try and destroy then null it in Reset, but it is never assigned to, you use a local with the same name in LateUpdate instead 😉