We've narrowed down the problem based on this post by Nate:
Skinning
"We used to do a lookup every frame for an AttachmentTimeline, but it proved to be a performance bottleneck for animations with many of those timelines....We changed AttachmentTimeline to only lookup and set the attachment when the frame with the key is crossed."
In the Animation.cs file for the AttachmentTimeline class:
public void Apply (Skeleton skeleton, float lastTime, float time, ExposedList<Event> firedEvents, float alpha) {
float[] frames = this.frames;
if (time < frames[0]) {
if (lastTime > time) Apply(skeleton, lastTime, int.MaxValue, null, 0);
return;
} else if (lastTime > time) //
lastTime = -1;
int frameIndex = (time >= frames[frames.Length - 1] ? frames.Length : Animation.binarySearch(frames, time)) - 1;
if (frames[frameIndex] < lastTime) return;
String attachmentName = attachmentNames[frameIndex];
skeleton.slots.Items[slotIndex].Attachment =
attachmentName == null ? null : skeleton.GetAttachment(slotIndex, attachmentName);
}
When we change it to:
public void Apply (Skeleton skeleton, float lastTime, float time, ExposedList<Event> firedEvents, float alpha)
{
String attachmentName = attachmentNames[0];
skeleton.slots.Items[slotIndex].Attachment = (attachmentName == null ? null : skeleton.GetAttachment(slotIndex, attachmentName));
}
The slot attachment updates immediately! Obviously this re-introduces the bottleneck Nate was talking about and we need to find a good way handle this. We will continue on and post a solution soon hopefully.