Weird issue with mesh.Clear()

Hi there,

I'm filling a custom mesh by code. Each frame I do the following:

if (QuadsToRender>0){
// copy buffers to sharedMesh

When playing this works well. When I run this in EditMode (@ExecuteInEditor), the mesh won't render at all, no extra DrawCall for this mesh though I push tons of quads in it.

The strange thing: when I change the code and place the call to mesh.Clear() inside the condition to clear only when drawing something, it works - the mesh shows up. It seems that calling Clear() flags the mesh to be empty internally and that this state does not change once there is something to render in it.

I really appreciate any help on this topic!

Thanks in advance


After changing the way I mute unused quads the problem disappeared. Before I set triagles to zero, now I set the vertices to