Best way to generate texture coordinates?

I'm generating some meshes at runtime (actually reading from a file), which may or may not have texture coords. I assign the Transparent/Specular map to the objects. In some cases I get this on my console:

Shader wants texture coordinates, but the mesh doesn't have them UnityEditor.DockArea:OnGUI() Shader wants secondary texture coordinates, but the mesh doesn't have any UnityEditor.DockArea:OnGUI()

So, do I have to generate texture coordinates?, and secondary ones (???) Is there any facility for this in Unity, if not, any good resources on how to generate these? Thanks

The example shown at Mesh.uv does exactly what you want. You may need to assign .uv2 too.

ps. Read more Unity Script Reference ;)