List<Vector3> verts = new List<Vector3>();
for(int y = 0; y < 1001; y++)
{
for (int x = 0; x < 1001; x++)
{
verts.Add(new Vector3(x, 0f, y));
}
}
List<int> tris = new List<int>();
for(int y = 0; y < 1000; y++)
{
for (int x = 0; x < 1000; x++)
{
tris.Add((y * 1001) + x);
tris.Add(((y + 1) * 1001) + x);
tris.Add((y * 1001) + x + 1);
tris.Add(((y + 1) * 1001) + x);
tris.Add(((y + 1) * 1001) + x + 1);
tris.Add((y * 1001) + x + 1);
}
}
var mf = one.GetComponent<MeshFilter>();
mf.mesh.vertices = verts.ToArray();
mf.mesh.triangles = tris.ToArray();
mf.mesh.RecalculateBounds();