mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49: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>
|
/// <summary>The current attachment for the slot, or null if the slot has no attachment.</summary>
|
||||||
get { return attachment; }
|
get { return attachment; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sets the slot's attachment and, if the attachment changed, resets <see cref="AttachmentTime"/> and clears
|
/// Sets the slot's attachment and, if the attachment changed, resets <see cref="AttachmentTime"/> and clears the <see cref="Deform"/>.
|
||||||
/// <see cref="Deform">.</summary>
|
/// 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>
|
/// <param name="value">May be null.</param>
|
||||||
set {
|
set {
|
||||||
if (attachment == value) return;
|
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;
|
attachmentTime = bone.skeleton.time;
|
||||||
deform.Clear(false);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user