Refresh wake mesh indices when the trail changes size
This commit is contained in:
@@ -113,8 +113,11 @@ namespace Soundings
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
mesh.SetVertices(positions, 0, row * Columns);
|
int vertexCount = row * Columns;
|
||||||
mesh.SetUVs(0, profiles, 0, row * Columns);
|
if (mesh.vertexCount != vertexCount)
|
||||||
|
mesh.Clear();
|
||||||
|
mesh.SetVertices(positions, 0, vertexCount);
|
||||||
|
mesh.SetUVs(0, profiles, 0, vertexCount);
|
||||||
mesh.SetIndices(triangles, 0, (row - 1) * (Columns - 1) * 6, MeshTopology.Triangles, 0, true);
|
mesh.SetIndices(triangles, 0, (row - 1) * (Columns - 1) * 6, MeshTopology.Triangles, 0, true);
|
||||||
Bounds bounds = mesh.bounds;
|
Bounds bounds = mesh.bounds;
|
||||||
bounds.Expand(new Vector3(0, 4, 0));
|
bounds.Expand(new Vector3(0, 4, 0));
|
||||||
|
|||||||
Reference in New Issue
Block a user