From 76b7e245bd36c541fb051cf3cc0fc3d4b507c566 Mon Sep 17 00:00:00 2001 From: John Date: Tue, 11 Jul 2017 06:37:32 +0800 Subject: [PATCH] [csharp] Fixes for clipping. based on : https://github.com/EsotericSoftware/spine-runtimes/commit/ea6319820f996856293b9ef6ee387b73cd7b1a58 Fixes: https://github.com/EsotericSoftware/spine-runtimes/pull/936 --- spine-csharp/src/SkeletonJson.cs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/spine-csharp/src/SkeletonJson.cs b/spine-csharp/src/SkeletonJson.cs index 3cfbdc76f..848adb4a5 100644 --- a/spine-csharp/src/SkeletonJson.cs +++ b/spine-csharp/src/SkeletonJson.cs @@ -420,10 +420,17 @@ namespace Spine { ClippingAttachment clip = attachmentLoader.NewClippingAttachment(skin, name); if (clip == null) return null; - SlotData slot = skeletonData.FindSlot(GetString(map, "end", null)); - if (slot == null) throw new Exception("Clipping end slot not found: " + GetString(map, "end", null)); - clip.endSlot = slot; + string end = GetString(map, "end", null); + if (end != null) { + SlotData slot = skeletonData.FindSlot(end); + if (slot == null) throw new Exception("Clipping end slot not found: " + end); + clip.EndSlot = slot; + } + ReadVertices(map, clip, GetInt(map, "vertexCount", 0) << 1); + + //string color = GetString(map, "color", null); + // if (color != null) clip.color = color; return clip; } }