mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-25 22:23:42 +08:00
[csharp] Fixed copies of RegionAttachment not playing back Sequence timelines. See #3040.
This commit is contained in:
parent
73a50ef12d
commit
f3f5574eff
@ -1923,9 +1923,9 @@ namespace Spine {
|
||||
|
||||
Attachment slotAttachment = pose.attachment;
|
||||
if (slotAttachment != attachment) {
|
||||
VertexAttachment vertexAttachment = slotAttachment as VertexAttachment;
|
||||
if ((vertexAttachment == null)
|
||||
|| vertexAttachment.TimelineAttachment != attachment) return;
|
||||
IHasSequence sequenceAttachment = slotAttachment as IHasSequence;
|
||||
if ((sequenceAttachment == null)
|
||||
|| sequenceAttachment.TimelineAttachment != attachment) return;
|
||||
}
|
||||
|
||||
if (direction == MixDirection.Out) {
|
||||
|
||||
@ -42,6 +42,9 @@ namespace Spine {
|
||||
void SetColor (Color32F color);
|
||||
void SetColor (float r, float g, float b, float a);
|
||||
Sequence Sequence { get; }
|
||||
/// <summary>Timelines for the timeline attachment are also applied to this attachment.
|
||||
/// May be null if no attachment-specific timelines should be applied.</summary>
|
||||
Attachment TimelineAttachment { get; set; }
|
||||
void UpdateSequence ();
|
||||
}
|
||||
}
|
||||
|
||||
@ -56,8 +56,7 @@ namespace Spine {
|
||||
|
||||
/// <summary>The UV pair for each vertex, normalized within the texture region.</summary>
|
||||
public float[] RegionUVs { get { return regionUVs; } set { regionUVs = value; } }
|
||||
/// <summary>The UV pair for each vertex, normalized within the entire texture.
|
||||
/// <seealso cref="MeshAttachment.UpdateRegion"/></summary>
|
||||
/// <summary>Triplets of vertex indices which describe the mesh's triangulation.</summary>
|
||||
public int[] Triangles { get { return triangles; } set { triangles = value; } }
|
||||
|
||||
public Color32F GetColor () {
|
||||
@ -74,6 +73,10 @@ namespace Spine {
|
||||
|
||||
public string Path { get { return path; } set { path = value; } }
|
||||
public Sequence Sequence { get { return sequence; } }
|
||||
Attachment IHasSequence.TimelineAttachment {
|
||||
get { return timelineAttachment; }
|
||||
set { timelineAttachment = (VertexAttachment)value; }
|
||||
}
|
||||
|
||||
public MeshAttachment ParentMesh {
|
||||
get { return parentMesh; }
|
||||
|
||||
@ -46,6 +46,7 @@ namespace Spine {
|
||||
public const int BRX = 6, BRY = 7;
|
||||
|
||||
internal readonly Sequence sequence;
|
||||
internal Attachment timelineAttachment;
|
||||
internal float x, y, rotation, scaleX = 1, scaleY = 1, width, height;
|
||||
// Color is a struct, set to protected to prevent
|
||||
// Color color = slot.color; color.a = 0.5;
|
||||
@ -75,11 +76,13 @@ namespace Spine {
|
||||
|
||||
public string Path { get; set; }
|
||||
public Sequence Sequence { get { return sequence; } }
|
||||
public Attachment TimelineAttachment { get { return timelineAttachment; } set { timelineAttachment = value; } }
|
||||
|
||||
public RegionAttachment (string name, Sequence sequence)
|
||||
: base(name) {
|
||||
if (sequence == null) throw new ArgumentException("sequence cannot be null.", "sequence");
|
||||
this.sequence = sequence;
|
||||
timelineAttachment = this;
|
||||
}
|
||||
|
||||
/// <summary>Copy constructor.</summary>
|
||||
@ -95,6 +98,7 @@ namespace Spine {
|
||||
height = other.height;
|
||||
color = other.color;
|
||||
sequence = new Sequence(other.sequence);
|
||||
timelineAttachment = other.timelineAttachment;
|
||||
}
|
||||
|
||||
/// <summary><para>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user