1
0
mirror of https://github.com/maxartz15/MA_TextureAtlasser.git synced 2025-05-06 13:55:45 +02:00

Update MeshUtils, set colors after setting verticies.

Update MeshUtils, set colors after setting vertices, Unity will throw an error when there are more colors than vertices.
This commit is contained in:
max 2019-11-26 19:48:25 +01:00
parent 279edb1e0e
commit 947eb6f18e

@ -43,7 +43,6 @@ namespace MA_Mesh
{
name = mesh.name,
bounds = mesh.bounds,
colors = mesh.colors,
subMeshCount = mesh.subMeshCount
};
@ -55,6 +54,7 @@ namespace MA_Mesh
newMesh.SetNormals(new List<Vector3>(mesh.normals));
newMesh.SetUVs(0, new List<Vector2>(mesh.uv));
newMesh.SetTangents(new List<Vector4>(mesh.tangents));
newMesh.SetColors(new List<Color>(mesh.colors));
return newMesh;
}