Using unity 2020.3, Burst Compiler and Jobs I’m trying to create a fast mesh generator. Everything works with the following code:
JobHandle createMeshJobHandle = createMeshJob.Schedule();
createMeshJobHandle.Complete();
// Assign
mesh.SetVertices( createMeshJob.vertices );
mesh.triangles = createMeshJob.triangles.ToArray();
mesh.SetColors( createMeshJob.colors );
I don’t like that I am converting the createMeshJob.triangles to an array instead o fusing the mesh.triangles setter. How can I use SetTriangles instead without doing the .ToArray()?