How do I texture a mesh runtime?

I need to texture my procedural mesh runtime. How do I do it? Unwrapping.GeneratePerTriangleUV seems to be removed. Also how do I get height and normalmaps to work?

I’m sorry, I moved this to forums: http://forum.unity3d.com/threads/texturing-and-uv-mapping-a-procedural-mesh.345001/
I also shared the code.

Set the UV array for the mesh. Each entry in the array corresponds to the appropriate vertex in the vertex array for the mesh. What values you use depends entirely on how you want to texture the mesh.

Solution: material.mainTexture.wrapMode = TextureWrapMode.Repeat; and calculating tangents. Eric was kinda right but it didn’t help me.