diff --git a/spine-unity/Assets/Spine Examples/Scripts/RenderTextureFadeoutExample.cs b/spine-unity/Assets/Spine Examples/Scripts/RenderTextureFadeoutExample.cs index 4f42ec4b2..8b24fe850 100644 --- a/spine-unity/Assets/Spine Examples/Scripts/RenderTextureFadeoutExample.cs +++ b/spine-unity/Assets/Spine Examples/Scripts/RenderTextureFadeoutExample.cs @@ -27,6 +27,10 @@ * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ +#if UNITY_2017_2_OR_NEWER +#define HAS_VECTOR_INT +#endif + using UnityEngine; using UnityEngine.Events; @@ -43,10 +47,14 @@ namespace Spine.Unity.Examples { // due to overlapping attachment meshes. normalSkeletonRenderer.Skeleton.SetColor(new Color(1, 1, 1, fadeoutAlpha)); +#if HAS_VECTOR_INT // Thus we render the whole skeleton to a RenderTexture first using the // SkeletonRenderTexture component. // Changing transparency at a single quad with a RenderTexture works as desired. skeletonRenderTexture.color.a = fadeoutAlpha; +#else + Debug.LogError("The SkeletonRenderTexture component requires Unity 2017.2 or newer."); +#endif } } } diff --git a/spine-unity/Assets/Spine Examples/Scripts/Sample Components/SkeletonRenderTexture/SkeletonRenderTexture.cs b/spine-unity/Assets/Spine Examples/Scripts/Sample Components/SkeletonRenderTexture/SkeletonRenderTexture.cs index 958a7c3b4..08bf54734 100644 --- a/spine-unity/Assets/Spine Examples/Scripts/Sample Components/SkeletonRenderTexture/SkeletonRenderTexture.cs +++ b/spine-unity/Assets/Spine Examples/Scripts/Sample Components/SkeletonRenderTexture/SkeletonRenderTexture.cs @@ -31,6 +31,10 @@ #define HAS_FORCE_RENDER_OFF #endif +#if UNITY_2017_2_OR_NEWER +#define HAS_VECTOR_INT +#endif + using System.Collections.Generic; using UnityEngine; using UnityEngine.Rendering; @@ -39,6 +43,7 @@ namespace Spine.Unity.Examples { [RequireComponent(typeof(SkeletonRenderer))] public class SkeletonRenderTexture : MonoBehaviour { +#if HAS_VECTOR_INT public Color color = Color.white; public Material quadMaterial; public Camera targetCamera; @@ -230,5 +235,6 @@ namespace Spine.Unity.Examples { allocatedRenderTextureSize = textureSize; } } +#endif } }