diff --git a/spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonRenderSeparator/SkeletonRenderSeparator.cs b/spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonRenderSeparator/SkeletonRenderSeparator.cs index af83f6d34..627647599 100644 --- a/spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonRenderSeparator/SkeletonRenderSeparator.cs +++ b/spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonRenderSeparator/SkeletonRenderSeparator.cs @@ -30,6 +30,11 @@ #if UNITY_2018_3 || UNITY_2019 || UNITY_2018_3_OR_NEWER #define NEW_PREFAB_SYSTEM #endif + +#if UNITY_2018_1_OR_NEWER +#define HAS_PROPERTY_BLOCK_QUERY +#endif + #define SPINE_OPTIONAL_RENDEROVERRIDE using System.Collections.Generic; @@ -207,7 +212,12 @@ namespace Spine.Unity { int rendererCount = partsRenderers.Count; if (rendererCount <= 0) return; - if (copyPropertyBlock) +#if HAS_PROPERTY_BLOCK_QUERY + bool assignPropertyBlock = this.copyPropertyBlock && mainMeshRenderer.HasPropertyBlock(); +#else + bool assignPropertyBlock = this.copyPropertyBlock; +#endif + if (assignPropertyBlock) mainMeshRenderer.GetPropertyBlock(copiedBlock); MeshGenerator.Settings settings = new MeshGenerator.Settings { @@ -234,9 +244,8 @@ namespace Spine.Unity { MeshGenerator meshGenerator = currentRenderer.MeshGenerator; meshGenerator.settings = settings; - if (copyPropertyBlock) + if (assignPropertyBlock) currentRenderer.SetPropertyBlock(copiedBlock); - // Render currentRenderer.RenderParts(instruction.submeshInstructions, start, si + 1); diff --git a/spine-unity/Assets/Spine/package.json b/spine-unity/Assets/Spine/package.json index 4091c3c47..a67fa0dfb 100644 --- a/spine-unity/Assets/Spine/package.json +++ b/spine-unity/Assets/Spine/package.json @@ -2,7 +2,7 @@ "name": "com.esotericsoftware.spine.spine-unity", "displayName": "spine-unity Runtime", "description": "This plugin provides the spine-unity runtime core.", - "version": "4.2.19", + "version": "4.2.20", "unity": "2018.3", "author": { "name": "Esoteric Software",