mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-20 09:16:01 +08:00
[csharp] Port of commit 14b3170 "Keep slot deform when changing the attachment if the new attachment is compatible with the deform.", see #1896.
This commit is contained in:
parent
14b317008b
commit
e7533dff0f
@ -135,14 +135,18 @@ namespace Spine {
|
||||
/// <summary>The current attachment for the slot, or null if the slot has no attachment.</summary>
|
||||
get { return attachment; }
|
||||
/// <summary>
|
||||
/// Sets the slot's attachment and, if the attachment changed, resets <see cref="AttachmentTime"/> and clears
|
||||
/// <see cref="Deform">.</summary>
|
||||
/// Sets the slot's attachment and, if the attachment changed, resets <see cref="AttachmentTime"/> and clears the <see cref="Deform"/>.
|
||||
/// The deform is not cleared if the old attachment has the same <see cref="VertexAttachment.DeformAttachment"/> as the specified
|
||||
/// attachment.</summary>
|
||||
/// <param name="value">May be null.</param>
|
||||
set {
|
||||
if (attachment == value) return;
|
||||
attachment = value;
|
||||
if (!(value is VertexAttachment) || !(this.attachment is VertexAttachment)
|
||||
|| ((VertexAttachment)value).DeformAttachment != ((VertexAttachment)this.attachment).DeformAttachment) {
|
||||
deform.Clear();
|
||||
}
|
||||
this.attachment = value;
|
||||
attachmentTime = bone.skeleton.time;
|
||||
deform.Clear(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user