[unity] Fixed BlendModeMaterials ApplyMaterials ignoring sequence if Region already assigned. Closes #3033.

This commit is contained in:
Harald Csaszar 2026-02-25 15:10:20 +01:00
parent c3bb4130fe
commit 945be36fea
2 changed files with 11 additions and 10 deletions

View File

@ -270,17 +270,18 @@ namespace Spine.Unity {
foreach (Skin.SkinEntry entry in skinEntries) {
IHasTextureRegion renderableAttachment = entry.Attachment as IHasTextureRegion;
if (renderableAttachment != null) {
if (renderableAttachment.Region != null) {
if (renderableAttachment.Sequence != null) {
TextureRegion[] regions = renderableAttachment.Sequence.Regions;
for (int i = 0; i < regions.Length; ++i) {
regions[i] = CloneAtlasRegionWithMaterial(
(AtlasRegion)regions[i], replacementMaterials);
}
if (regions.Length > 0) {
renderableAttachment.Region = regions[0];
}
} else if (renderableAttachment.Region != null) {
renderableAttachment.Region = CloneAtlasRegionWithMaterial(
(AtlasRegion)renderableAttachment.Region, replacementMaterials);
} else {
if (renderableAttachment.Sequence != null) {
TextureRegion[] regions = renderableAttachment.Sequence.Regions;
for (int i = 0; i < regions.Length; ++i) {
regions[i] = CloneAtlasRegionWithMaterial(
(AtlasRegion)regions[i], replacementMaterials);
}
}
}
}
}

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 and examples. Spine Examples can be installed via the Samples tab.",
"version": "4.3.47",
"version": "4.3.48",
"unity": "2018.3",
"author": {
"name": "Esoteric Software",