[unity] Fixed material being cleared to null when MeshRenderer is disabled in the editor. Closes #1288.

This commit is contained in:
Harald Csaszar 2019-03-04 18:27:57 +01:00
parent 2db16cc384
commit 088fb2ea02

View File

@ -268,7 +268,7 @@ namespace Spine.Unity {
meshFilter.sharedMesh = null;
meshRenderer = GetComponent<MeshRenderer>();
if (meshRenderer != null) meshRenderer.sharedMaterial = null;
if (meshRenderer != null && meshRenderer.enabled) meshRenderer.sharedMaterial = null;
currentInstructions.Clear();
rendererBuffers.Clear();