public void UpdateVertices(Vector3[] vertices = null, Vector2[] uvs = null, Color[] colors = null) { if (!MeshObject) { throw new InvalidOperationException( "Mesh is not generated yet. Call GenerateMesh() first."); } if (vertices != null) { MeshObject.vertices = vertices; } if (uvs != null) { MeshObject.uv = uvs; } if (colors != null) { MeshObject.colors = colors; } if (vertices != null) { MeshObject.RecalculateBounds(); MeshObject.RecalculateNormals(); MeshObject.RecalculateTangents(); } if (vertices != null || uvs != null || colors != null) { MeshObject.UploadMeshData(!_dynamicMesh); } }