Skip to content

Commit

Permalink
Potential fix for issue #70
Browse files Browse the repository at this point in the history
  • Loading branch information
keenanwoodall committed Apr 9, 2022
1 parent 324d697 commit 89cef1a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions Code/Runtime/Mesh/Data/MeshTarget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,9 @@ public Renderer GetRenderer ()
{
if (skinnedMeshRenderer != null)
return skinnedMeshRenderer;
else if (meshFilter != null)
if (meshFilter != null)
return meshFilter.GetComponent<MeshRenderer> ();
else
return null;
return null;
}

/// <summary>
Expand Down
4 changes: 2 additions & 2 deletions Code/Runtime/Mesh/Deformable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,8 @@ protected void Update()
#endif
protected bool IsVisible()
{
bool isVisible = data.Target.GetRenderer().isVisible;
return isVisible;
var renderer = data.Target.GetRenderer();
return renderer != null && renderer.isVisible;
}

protected bool ShouldCull(bool ignoreCullingMode)
Expand Down

0 comments on commit 89cef1a

Please sign in to comment.