mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-07 11:16: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.Clear(false);
|
||||||
drawOrder.GrowIfNeeded(n);
|
drawOrder.GrowIfNeeded(n);
|
||||||
System.Array.Copy(slotsItems, drawOrder.Items, n);
|
System.Array.Copy(slotsItems, drawOrder.Items, n);
|
||||||
|
drawOrder.Count = n;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>Resets the color of a slot to Setup Pose value.</summary>
|
/// <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>
|
/// <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) {
|
public static void SetSlotAttachmentToSetupPose (this Skeleton skeleton, int slotIndex) {
|
||||||
var slot = skeleton.slots.Items[slotIndex];
|
var slot = skeleton.slots.Items[slotIndex];
|
||||||
var attachment = skeleton.GetAttachment(slotIndex, slot.data.attachmentName);
|
// Based on Slot.SetToSetupPose
|
||||||
slot.Attachment = attachment;
|
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>
|
/// <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