[unity] Fixed GetRepackedSkin not always working with sequences. See #2268.

This commit is contained in:
Harald Csaszar 2023-12-01 15:59:33 +01:00
parent 5e0bb98fa0
commit 72b2b9c26f
2 changed files with 5 additions and 2 deletions

View File

@ -361,12 +361,15 @@ namespace Spine.Unity.AttachmentTools {
originalAttachment.Copy();
IHasTextureRegion newTextureAttachment = (IHasTextureRegion)newAttachment;
AtlasRegion region = newTextureAttachment.Region as AtlasRegion;
if (region == null && originalTextureAttachment.Sequence != null)
region = (AtlasRegion)originalTextureAttachment.Sequence.Regions[0];
int existingIndex;
if (existingRegions.TryGetValue(region, out existingIndex)) {
regionIndices.Add(existingIndex);
} else {
Sequence originalSequence = originalTextureAttachment.Sequence;
existingRegions.Add(region, newRegionIndex);
Sequence originalSequence = originalTextureAttachment.Sequence;
if (originalSequence != null) {
newTextureAttachment.Sequence = new Sequence(originalSequence);
for (int i = 0, regionCount = originalSequence.Regions.Length; i < regionCount; ++i) {

View File

@ -2,7 +2,7 @@
"name": "com.esotericsoftware.spine.spine-unity",
"displayName": "spine-unity Runtime",
"description": "This plugin provides the spine-unity runtime core.",
"version": "4.2.36",
"version": "4.2.37",
"unity": "2018.3",
"author": {
"name": "Esoteric Software",