mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[unity] Fixed GetRepackedSkin not always working with sequences. See #2268.
This commit is contained in:
parent
5e0bb98fa0
commit
72b2b9c26f
@ -361,12 +361,15 @@ namespace Spine.Unity.AttachmentTools {
|
|||||||
originalAttachment.Copy();
|
originalAttachment.Copy();
|
||||||
IHasTextureRegion newTextureAttachment = (IHasTextureRegion)newAttachment;
|
IHasTextureRegion newTextureAttachment = (IHasTextureRegion)newAttachment;
|
||||||
AtlasRegion region = newTextureAttachment.Region as AtlasRegion;
|
AtlasRegion region = newTextureAttachment.Region as AtlasRegion;
|
||||||
|
if (region == null && originalTextureAttachment.Sequence != null)
|
||||||
|
region = (AtlasRegion)originalTextureAttachment.Sequence.Regions[0];
|
||||||
|
|
||||||
int existingIndex;
|
int existingIndex;
|
||||||
if (existingRegions.TryGetValue(region, out existingIndex)) {
|
if (existingRegions.TryGetValue(region, out existingIndex)) {
|
||||||
regionIndices.Add(existingIndex);
|
regionIndices.Add(existingIndex);
|
||||||
} else {
|
} else {
|
||||||
Sequence originalSequence = originalTextureAttachment.Sequence;
|
|
||||||
existingRegions.Add(region, newRegionIndex);
|
existingRegions.Add(region, newRegionIndex);
|
||||||
|
Sequence originalSequence = originalTextureAttachment.Sequence;
|
||||||
if (originalSequence != null) {
|
if (originalSequence != null) {
|
||||||
newTextureAttachment.Sequence = new Sequence(originalSequence);
|
newTextureAttachment.Sequence = new Sequence(originalSequence);
|
||||||
for (int i = 0, regionCount = originalSequence.Regions.Length; i < regionCount; ++i) {
|
for (int i = 0, regionCount = originalSequence.Regions.Length; i < regionCount; ++i) {
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
"name": "com.esotericsoftware.spine.spine-unity",
|
"name": "com.esotericsoftware.spine.spine-unity",
|
||||||
"displayName": "spine-unity Runtime",
|
"displayName": "spine-unity Runtime",
|
||||||
"description": "This plugin provides the spine-unity runtime core.",
|
"description": "This plugin provides the spine-unity runtime core.",
|
||||||
"version": "4.2.36",
|
"version": "4.2.37",
|
||||||
"unity": "2018.3",
|
"unity": "2018.3",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Esoteric Software",
|
"name": "Esoteric Software",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user