I need to generate a procedural mesh with an unknown number of verts. So far, what I’m doing is this:
Vector3[] vertices=new Vector3[LargeNumber];
int vertCount=0;
loopsAndFunctions{
...
vertices[vertCount++]=newVert;
...
}
Vector3[] newVertices=new Vector3[vertCount];
for(int i=0;i<vertCount;i++){
newVertices_=vertices*;*_
}
mesh.vertices=newVertices;
which is ugly. What is the standard method for doing this? I was told that assigning to mesh.vertices*
is slow; is that true?*