Skip to content

Commit

Permalink
fix PR #2
Browse files Browse the repository at this point in the history
  • Loading branch information
hybridherbst committed Oct 2, 2020
1 parent cda379c commit 2ecd11c
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -714,10 +714,11 @@ private CameraId ExportCamera(Camera unityCamera)

private static bool ContainsValidRenderer(GameObject gameObject)
{
var meshRender = gameObject.GetComponent<MeshRenderer>();
if(!gameObject) return false;
var meshRenderer = gameObject.GetComponent<MeshRenderer>();
var meshFilter = gameObject.GetComponent<MeshFilter>();
var skinnedMeshRender = gameObject.GetComponent<SkinnedMeshRenderer>();
return (meshFilter != null && meshRender != null && meshRender.enabled) || (skinnedMeshRender != null && skinnedMeshRender.enabled);
return (meshFilter && meshRenderer && meshRenderer.enabled) || (skinnedMeshRender && skinnedMeshRender.enabled);
}

private void FilterPrimitives(Transform transform, out GameObject[] primitives, out GameObject[] nonPrimitives)
Expand Down

0 comments on commit 2ecd11c

Please sign in to comment.