mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-06 23:34:53 +08:00
[unity] SkeletonExtensions fixes.
https://github.com/EsotericSoftware/spine-runtimes/issues/700
This commit is contained in:
parent
b597aac9b9
commit
a67850cbe8
@ -130,6 +130,7 @@ namespace Spine {
|
||||
drawOrder.Clear(false);
|
||||
drawOrder.GrowIfNeeded(n);
|
||||
System.Array.Copy(slotsItems, drawOrder.Items, n);
|
||||
drawOrder.Count = n;
|
||||
}
|
||||
|
||||
/// <summary>Resets the color of a slot to Setup Pose value.</summary>
|
||||
@ -149,8 +150,13 @@ namespace Spine {
|
||||
/// <summary>Resets the attachment of slot at a given slotIndex to setup pose. This is faster than Slot.SetAttachmentToSetupPose.</summary>
|
||||
public static void SetSlotAttachmentToSetupPose (this Skeleton skeleton, int slotIndex) {
|
||||
var slot = skeleton.slots.Items[slotIndex];
|
||||
var attachment = skeleton.GetAttachment(slotIndex, slot.data.attachmentName);
|
||||
slot.Attachment = attachment;
|
||||
// Based on Slot.SetToSetupPose
|
||||
if (slot.data.attachmentName == null)
|
||||
slot.Attachment = null;
|
||||
else {
|
||||
slot.attachment = null;
|
||||
slot.Attachment = skeleton.GetAttachment(slotIndex, slot.data.attachmentName);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Resets Skeleton parts to Setup Pose according to a Spine.Animation's keyed items.</summary>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user