Browse Source

[unity] AttachmentTools handle Points and Clipping

John 8 years ago
parent
commit
7361358121

+ 25 - 0
spine-unity/Assets/spine-unity/Modules/AttachmentTools/AttachmentTools.cs

@@ -798,6 +798,14 @@ namespace Spine.Unity.Modules.AttachmentTools {
 			if (pathAttachment != null)
 			if (pathAttachment != null)
 				return pathAttachment.GetClone();
 				return pathAttachment.GetClone();
 
 
+			var pointAttachment = o as PointAttachment;
+			if (pointAttachment != null)
+				return pointAttachment.GetClone();
+
+			var clippingAttachment = o as ClippingAttachment;
+			if (clippingAttachment != null)
+				return clippingAttachment.GetClone();
+
 			return null;
 			return null;
 		}
 		}
 
 
@@ -829,6 +837,23 @@ namespace Spine.Unity.Modules.AttachmentTools {
 			};
 			};
 		}
 		}
 
 
+		public static ClippingAttachment GetClone (this ClippingAttachment o) {
+			var ca = new ClippingAttachment(o.Name) {
+				endSlot = o.endSlot
+			};
+			CloneVertexAttachment(o, ca);
+			return ca;
+		}
+
+		public static PointAttachment GetClone (this PointAttachment o) {
+			var pa = new PointAttachment(o.Name) {
+				rotation = o.rotation,
+				x = o.x,
+				y = o.y
+			};
+			return pa;
+		}
+
 		public static BoundingBoxAttachment GetClone (this BoundingBoxAttachment o) {
 		public static BoundingBoxAttachment GetClone (this BoundingBoxAttachment o) {
 			var ba = new BoundingBoxAttachment(o.Name);
 			var ba = new BoundingBoxAttachment(o.Name);
 			CloneVertexAttachment(o, ba);
 			CloneVertexAttachment(o, ba);