Hi,
I am currently moving from Cocos2D-X to Unity (I could not resist the beauty of Unity
), but I am new to Unity.
In Cocos2D-X I specify the vertices and textCoords for the texture so I can draw it In a special way, like in a specific area in any pattern I want.
In Cocos2D-X, the only thing I need to do is to generate textVertices and textCoords for the area and pattern, then in the draw method I feed it to OpenGL.
void VertexTexture::draw()
{
CC_NODE_DRAW_SETUP();
ccGLBindTexture2D(TextureName);
ccGLEnableVertexAttribs( kCCVertexAttribFlag_Position | kCCVertexAttribFlag_TexCoords);
glVertexAttribPointer(kCCVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, 0, &textVertices[0]);
glVertexAttribPointer(kCCVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, 0, &textCoords[0]);
glDrawArrays(GL_TRIANGLE_STRIP, 0, (GLsizei)textVertices.size());
}
But I cannot figure out how to accomplish that in Unity, I have been looking all over the internet for almost two days.
The only thing I found was a Vertex Texture Fetch to a shader, where I can manipulate properties such as position, color and texture coordinate. But and vertex shaders cannot create new vertices.
Please help me with this problem, Unity is too new to me to figure this out 
If you want low-level drawing functions, Unity has a âGLâ class which has lots of OpenGL-like syntax for specifying and drawing things one vertex at a time. Iâve used it to easily draw a full-screen quad at runtime, but in general it is not used very much.
You want to look into the âMeshâ class. A Mesh handles arrays of position, texture coordinates, normals, etc. in a multi-platform way. Under the hood it will be calling OpenGL or DirectX for you.
You also wonât need to call glDrawArrays yourself. Unity gameobjects that have a mesh renderer component will call all the functions required to draw the mesh to the screen for you (again, handling it properly for different platforms). You also have the âMaterialâ class which handles the details of initializing the shader, activating the proper textures, and hooking up all your properties.
Here is a quick video I found going through procedurally generating simple geometry:
http://www.youtube.com/watch?v=3jHe1FzrKD8
He goes through setting up a simple quad, but the same method should work for specifying whatever type of geometry you want.
Thank you so much for this great reply 
I like the âMeshâ class and methods, but it cannot work with âSpriteRendererâ classâŚ
Do you recommend me to dump the SpriteRenderer and use Mesh and MeshRenderer instead�
I am making a 2d mobile game and I use vertices extensivelyâŚ