Skip to content

Commit

Permalink
[csharp] Added shifted vertex attachment IDs for DeformTimeline.
Browse files Browse the repository at this point in the history
  • Loading branch information
pharan committed Jun 10, 2017
1 parent a8577b7 commit 14d031c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion spine-csharp/src/Animation.cs
Expand Up @@ -743,7 +743,7 @@ public class DeformTimeline : CurveTimeline {
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)
Expand Down
5 changes: 5 additions & 0 deletions spine-csharp/src/Attachments/VertexAttachment.cs
Expand Up @@ -33,10 +33,15 @@
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; } }
Expand Down

0 comments on commit 14d031c

Please sign in to comment.