MeshCreation Material Help

Hi

I am creating a script to procedurally generate objects.

I can create the mesh and define UV’s, what I don’t know how to do is assign separate materials to certain faces. I would have 4 different materials I would need to use. The question is, can it be done?

Create a submesh for each material, using SetTriangles.

–Eric