Removing Polygons From Mesh

Hello again, few deys i try to solve my problem with cross-section effect and now i try to solve it from c# and manipulating with mesh…

Here is script:
Splitting Script

private Mesh mesh;

    private Vector3[] verticesCopy;
    private Vector2[] uvsCopy;
    private int[] trianglesCopy;

    void Start () {
        mesh = GetComponent<MeshFilter>().mesh;
       
        verticesCopy = mesh.vertices;
        uvsCopy = mesh.uv;
        trianglesCopy = mesh.triangles;
       
        Vector3[] vertices = new Vector3[verticesCopy.Length];
        Vector2[] uvs = new Vector2[uvsCopy.Length];
        int[] triangles = new int[trianglesCopy.Length];
        int i = 0;

        while (i < vertices.Length)
        {
            if (transform.TransformPoint(vertices[i]).y < 25)
            {
                vertices[i] = verticesCopy[i];
                uvs[i] = uvsCopy[i];
                triangles[i] = trianglesCopy[i];
            }
            i++;
        }
       
        mesh.Clear();
        mesh.vertices = vertices;
        mesh.uv = uvs;
        mesh.triangles = triangles;
        mesh.RecalculateBounds();
        mesh.RecalculateTangents();
    }

    private void Update()
    {
        if(Input.GetKeyUp(KeyCode.Space))
        {
        mesh.Clear();
            mesh.vertices = verticesCopy;
            mesh.uv = uvsCopy;
            mesh.triangles = trianglesCopy;
            Debug.Log("done");
            mesh.RecalculateBounds();
            mesh.RecalculateTangents();
        }
    }

It already work how i need but problem is color of object is black and in renderer component i get warning “This renderer has more materials than the Mesh has submeshes” i understand what it mean but i dont know how to solve it. Because i clear whole mesh then all submeshes are disapear and then i create just one submesh but how to split it?.. Or am i wrong??

Ok i got it… I just need to do same calculation with mesh.normals;