From 947eb6f18ef2d6fc9a592e016dbbabef8333425a Mon Sep 17 00:00:00 2001 From: max Date: Tue, 26 Nov 2019 19:48:25 +0100 Subject: [PATCH] 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. --- Assets/MA_ToolBox/MA_Utilities/MeshUtils/MA_MeshUtils.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Assets/MA_ToolBox/MA_Utilities/MeshUtils/MA_MeshUtils.cs b/Assets/MA_ToolBox/MA_Utilities/MeshUtils/MA_MeshUtils.cs index 5ece2cd..2b07dd3 100644 --- a/Assets/MA_ToolBox/MA_Utilities/MeshUtils/MA_MeshUtils.cs +++ b/Assets/MA_ToolBox/MA_Utilities/MeshUtils/MA_MeshUtils.cs @@ -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(mesh.normals)); newMesh.SetUVs(0, new List(mesh.uv)); newMesh.SetTangents(new List(mesh.tangents)); + newMesh.SetColors(new List(mesh.colors)); return newMesh; }