效果
![生成的Quad](https://i-blog.csdnimg.cn/blog_migrate/2e125ed660af2a0bd8dff4bda47d950d.png)
代码
GameObject gameObject=new GameObject();
gameObject.AddComponent<MeshFilter>();
Mesh mesh = gameObject.GetComponent<MeshFilter>().mesh;
Vector3[] vectices = new Vector3[4];
int[] triangles = new int[6];
Vector2[] uvs = new Vector2[4];
int vIndex = 0;
int vIndex0 = vIndex;
int vIndex1 = vIndex + 1;
int vIndex2 = vIndex + 2;
int vIndex3 = vIndex + 3;
Vector3 pos = Vector3.zero;
vectices[vIndex0] = pos;
vectices[vIndex1] = pos + new Vector3(0, 1);
vectices[vIndex2] = pos + new Vector3(1, 1);
vectices[vIndex3] = pos + new Vector3(1, 0);
Vector2 uv00 = new Vector2(0,0);
Vector2 uv11 = new Vector2(1f, 1f);
uvs[vIndex0] = new Vector2(uv00.x, uv00.y);
uvs[vIndex1] = new Vector2(uv00.x, uv11.y);
uvs[vIndex2] = new Vector2(uv11.x, uv11.y);
uvs[vIndex3] = new Vector2(uv11.x, uv00.y);
int tIndex = 0;
triangles[tIndex] = vIndex0;
triangles[tIndex + 1] = vIndex1;
triangles[tIndex + 2] = vIndex2;
triangles[tIndex + 3] = vIndex2;
triangles[tIndex + 4] = vIndex3;
triangles[tIndex + 5] = vIndex0;
mesh.vertices = vectices;
mesh.triangles = triangles;
mesh.uv = uvs;
gameObject.AddComponent<MeshRenderer>();
gameObject.GetComponent<MeshRenderer>().material = new Material(Shader.Find("Unlit/Texture"));