Ver código fonte

[csharp] Added shifted vertex attachment IDs for DeformTimeline.

pharan 8 anos atrás
pai
commit
14d031cb78

+ 1 - 1
spine-csharp/src/Animation.cs

@@ -743,7 +743,7 @@ namespace Spine {
 		public VertexAttachment Attachment { get { return attachment; } set { attachment = value; } }
 
 		override public int PropertyId {
-			get { return ((int)TimelineType.Deform << 24) + slotIndex; }
+			get { return ((int)TimelineType.Deform << 24) + attachment.id + slotIndex; }
 		}
 
 		public DeformTimeline (int frameCount)

+ 5 - 0
spine-csharp/src/Attachments/VertexAttachment.cs

@@ -33,10 +33,15 @@ using System;
 namespace Spine {
 	/// <summary>>An attachment with vertices that are transformed by one or more bones and can be deformed by a slot's vertices.</summary> 
 	public class VertexAttachment : Attachment {
+		static int nextID = 0;
+
+		internal int id = (nextID++ & 65535) << 11;
 		internal int[] bones;
 		internal float[] vertices;
 		internal int worldVerticesLength;
 
+		/// <summary>Gets a unique ID for this attachment.</summary>
+		public int Id { get { return id; } }
 		public int[] Bones { get { return bones; } set { bones = value; } }
 		public float[] Vertices { get { return vertices; } set { vertices = value; } }
 		public int WorldVerticesLength { get { return worldVerticesLength; } set { worldVerticesLength = value; } }