// If the colors array is null, use the default colors from Printer_Plane
if (colors == null)
{
colors = Printer_Plane.defaultColors;
}
// If the UV coordinates array is empty, select the default UV coordinates array based on the flip flag
if (uvs == null)
{
if (!flipUv)
{
uvs = Printer_Plane.defaultUvs;
}
else
{
uvs = Printer_Plane.defaultUvsFlipped;
}
}
// Get the SubMesh for the specified material
LayerSubMesh subMesh = layer.GetSubMesh(mat);
// Record the current number of vertices
int count = subMesh.verts.Count;
// Add the four vertices of the plane
subMesh.verts.Add(new Vector3(-0.5f * size.x, 0f, -0.5f * size.y));
subMesh.verts.Add(new Vector3(-0.5f * size.x, topVerticesAltitudeBias, 0.5f * size.y));
subMesh.verts.Add(new Vector3(0.5f * size.x, topVerticesAltitudeBias, 0.5f * size.y));
subMesh.verts.Add(new Vector3(0.5f * size.x, 0f, -0.5f * size.y));
// If the rotation angle is not 0, apply rotation transformation to the vertices
if (rot != 0f)
{
float num = rot * 0.0174532924f;
num *= -1f;
for (int i = 0; i < 4; i++)
{
float x = subMesh.verts[count + i].x;
float z = subMesh.verts[count + i].z;
float num2 = Mathf.Cos(num);
float num3 = Mathf.Sin(num);
float x2 = x * num2 - z * num3;
float z2 = x * num3 + z * num2;
subMesh.verts[count + i] = new Vector3(x2, subMesh.verts[count + i].y, z2);
}
}
// Offset the vertex coordinates by the center point, and add UV coordinates and colors
for (int j = 0; j < 4; j++)
{
subMesh.verts[count + j] += center;
subMesh.uvs.Add(uvs[j]);
subMesh.colors.Add(colors[j]);
}
// Add triangle indices
subMesh.tris.Add(count);
subMesh.tris.Add(count + 1);
subMesh.tris.Add(count + 2);
subMesh.tris.Add(count);
subMesh.tris.Add(count + 2);
subMesh.tris.Add(count + 3);
I have this code which works on submeshes , I want o have blended edges currently they are jagged