[unity] Added another null check. See #1273, #1931.

This commit is contained in:
Harald Csaszar 2021-08-09 15:42:24 +02:00
parent e321488949
commit b8ec11f20e

View File

@ -416,11 +416,11 @@ namespace Spine.Unity {
public virtual void LateUpdateMesh () { public virtual void LateUpdateMesh () {
#if SPINE_OPTIONAL_RENDEROVERRIDE #if SPINE_OPTIONAL_RENDEROVERRIDE
bool doMeshOverride = generateMeshOverride != null; bool doMeshOverride = generateMeshOverride != null;
if ((!meshRenderer.enabled) && !doMeshOverride) return; if ((!meshRenderer || !meshRenderer.enabled) && !doMeshOverride) return;
#else #else
const bool doMeshOverride = false; const bool doMeshOverride = false;
if (!meshRenderer.enabled) return; if (!meshRenderer.enabled) return;
#endif #endif
var currentInstructions = this.currentInstructions; var currentInstructions = this.currentInstructions;
var workingSubmeshInstructions = currentInstructions.submeshInstructions; var workingSubmeshInstructions = currentInstructions.submeshInstructions;
var currentSmartMesh = rendererBuffers.GetNextMesh(); // Double-buffer for performance. var currentSmartMesh = rendererBuffers.GetNextMesh(); // Double-buffer for performance.