public static void AssignColors(this IMeshBuilder meshBuilder, MeshBuilderAssignColorsDelegate colorFunc) { meshBuilder.Colors.Clear(); for (int i = 0; i < meshBuilder.Vertices.Count; i++) { meshBuilder.AddColor(colorFunc(i, meshBuilder.Vertices[i])); } }