Refresh wake mesh indices when the trail changes size

This commit is contained in:
josh
2026-11-27 23:46:36 -05:00
parent 3e3aa5d5a1
commit 4722db6456

View File

@@ -113,8 +113,11 @@ namespace Soundings
return;
}
mesh.SetVertices(positions, 0, row * Columns);
mesh.SetUVs(0, profiles, 0, row * Columns);
int vertexCount = 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);
Bounds bounds = mesh.bounds;
bounds.Expand(new Vector3(0, 4, 0));