From 4722db6456f70fd4f91a702c5bd811e9e3948ef7 Mon Sep 17 00:00:00 2001 From: josh Date: Fri, 27 Nov 2026 23:46:36 -0500 Subject: [PATCH] Refresh wake mesh indices when the trail changes size --- Assets/Soundings/Runtime/PassageWake.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Assets/Soundings/Runtime/PassageWake.cs b/Assets/Soundings/Runtime/PassageWake.cs index a483c8e..154df90 100644 --- a/Assets/Soundings/Runtime/PassageWake.cs +++ b/Assets/Soundings/Runtime/PassageWake.cs @@ -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));