[unity] Call computeWorldVertices before accessing region uvs in SkeletonBaker. Fix only for cosmetic reasons, SkeletonBaker doesn't map sequence functionality to Unity skeletal animation. See #2154.

This commit is contained in:
Harald Csaszar 2022-09-15 11:33:41 +02:00
parent 669af9f6bb
commit 81708ebb0d

View File

@ -513,9 +513,9 @@ namespace Spine.Unity.Editor {
bone.UpdateWorldTransform();
Vector2[] uvs = ExtractUV(attachment.UVs);
float[] floatVerts = new float[8];
attachment.ComputeWorldVertices(slot, floatVerts, 0);
Vector2[] uvs = ExtractUV(attachment.UVs);
Vector3[] verts = ExtractVerts(floatVerts);
//unrotate verts now that they're centered
@ -550,9 +550,9 @@ namespace Spine.Unity.Editor {
slot.Bone.Y = 0;
slot.Bone.UpdateWorldTransform();
Vector2[] uvs = ExtractUV(attachment.UVs);
float[] floatVerts = new float[attachment.WorldVerticesLength];
attachment.ComputeWorldVertices(slot, floatVerts);
Vector2[] uvs = ExtractUV(attachment.UVs);
Vector3[] verts = ExtractVerts(floatVerts);
int[] triangles = attachment.Triangles;
@ -617,7 +617,6 @@ namespace Spine.Unity.Editor {
float[] floatVerts = new float[attachment.WorldVerticesLength];
attachment.ComputeWorldVertices(skeleton.Slots.Items[slotIndex], floatVerts);
Vector2[] uvs = ExtractUV(attachment.UVs);
Vector3[] verts = ExtractVerts(floatVerts);