From a740fae00950a1c6accf98e8375b2df36ee317dc Mon Sep 17 00:00:00 2001 From: Harald Csaszar Date: Thu, 7 Sep 2023 13:28:56 +0200 Subject: [PATCH] [unity] Fixed compile error of previous commit 238818d on Unity 2017. See #2358. --- .../SkeletonRenderSeparator/SkeletonRenderSeparator.cs | 9 +++++++++ 1 file changed, 9 insertions(+) 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 15471a916..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,11 @@ namespace Spine.Unity { int rendererCount = partsRenderers.Count; if (rendererCount <= 0) return; +#if HAS_PROPERTY_BLOCK_QUERY bool assignPropertyBlock = this.copyPropertyBlock && mainMeshRenderer.HasPropertyBlock(); +#else + bool assignPropertyBlock = this.copyPropertyBlock; +#endif if (assignPropertyBlock) mainMeshRenderer.GetPropertyBlock(copiedBlock);