From c90da0da7970c2c34b04eccb2b83dfeac56876bc Mon Sep 17 00:00:00 2001 From: ousttrue Date: Mon, 11 Oct 2021 15:11:38 +0900 Subject: [PATCH] Mesh.vertexCount before assignment --- Assets/UniGLTF/Runtime/UniGLTF/IO/MeshIO/MeshExportInfo.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Assets/UniGLTF/Runtime/UniGLTF/IO/MeshIO/MeshExportInfo.cs b/Assets/UniGLTF/Runtime/UniGLTF/IO/MeshIO/MeshExportInfo.cs index 154ed16f4..f4e9f10c4 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/IO/MeshIO/MeshExportInfo.cs +++ b/Assets/UniGLTF/Runtime/UniGLTF/IO/MeshIO/MeshExportInfo.cs @@ -201,7 +201,7 @@ namespace UniGLTF else if (renderer is MeshRenderer mr) { var filter = mr.GetComponent(); - if (filter.hideFlags == HideFlags.None && Mesh.vertexCount > 0 && filter != null) + if (filter != null && filter.hideFlags == HideFlags.None && filter.sharedMesh.vertexCount > 0) { Mesh = filter.sharedMesh; }