[csharp] Added shifted vertex attachment IDs for DeformTimeline.

This commit is contained in:
pharan 2017-06-11 00:38:38 +08:00
parent a8577b78a7
commit 14d031cb78
2 changed files with 6 additions and 1 deletions

View File

@ -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)

View File

@ -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; } }