示例#1
0
    // triangleVertIndecis must be a multiple of three, each triangle must have three vert indecis
    public static void AddTriangles(List <int> triangleVertIndecis, Mesh mesh)
    {
        EditedMesh meshEdit = new EditedMesh(mesh);

        meshEdit.AddTriangles(triangleVertIndecis);
        meshEdit.CopyTo(mesh);
    }
示例#2
0
    public static void AddUnitTriangle(Mesh mesh)
    {
        int        currentNumVerts = mesh.vertices.Length;
        EditedMesh meshEdit        = new EditedMesh(mesh);

        meshEdit.AddVerts(new List <Vector3>()
        {
            Vector3.zero, new Vector3(-1f, 0f, 0f), new Vector3(0f, 0f, 1f)
        });

        meshEdit.AddTriangles(new List <int>()
        {
            currentNumVerts, currentNumVerts + 1, currentNumVerts + 2
        });
        meshEdit.CopyTo(mesh);
    }