From c4a3239e51298a0647e11a53ded0181cd2196728 Mon Sep 17 00:00:00 2001 From: Harald Csaszar Date: Mon, 29 Sep 2025 17:18:00 +0200 Subject: [PATCH] [unity] Fixed PMA workflow preset related warnings only occurring on first import. Closes #2940. --- .../spine-unity/Editor/Utility/AssetUtility.cs | 13 ++++++++----- spine-unity/Assets/Spine/package.json | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/spine-unity/Assets/Spine/Editor/spine-unity/Editor/Utility/AssetUtility.cs b/spine-unity/Assets/Spine/Editor/spine-unity/Editor/Utility/AssetUtility.cs index 8c80660f5..5ca5b1eb5 100644 --- a/spine-unity/Assets/Spine/Editor/spine-unity/Editor/Utility/AssetUtility.cs +++ b/spine-unity/Assets/Spine/Editor/spine-unity/Editor/Utility/AssetUtility.cs @@ -652,9 +652,12 @@ namespace Spine.Unity.Editor { List vestigialMaterials = new List(); - if (atlasAsset == null) + bool isFirstImport; + if (atlasAsset == null) { + isFirstImport = true; atlasAsset = SpineAtlasAsset.CreateInstance(); - else { + } else { + isFirstImport = false; foreach (Material m in atlasAsset.materials) vestigialMaterials.Add(m); } @@ -667,7 +670,7 @@ namespace Spine.Unity.Editor { if (atlas != null) { foreach (AtlasPage page in atlas.Pages) pageFiles.Add(page.name); - IssuePMAWarnings(atlas, atlasAsset); + IssuePMAWarnings(isFirstImport, atlas, atlasAsset); } bool atlasHasCustomMaterials = HasCustomMaterialsAssigned(vestigialMaterials, primaryName, pageFiles); @@ -769,7 +772,7 @@ namespace Spine.Unity.Editor { return loadedAtlas != null ? loadedAtlas : atlasAsset; } - static void IssuePMAWarnings (Atlas atlas, SpineAtlasAsset atlasAsset) { + static void IssuePMAWarnings (bool isFirstImport, Atlas atlas, SpineAtlasAsset atlasAsset) { bool isPMA = atlas.Pages.Count > 0 && atlas.Pages[0].pma; if (QualitySettings.activeColorSpace == ColorSpace.Linear && isPMA) { bool wasFixed = false; @@ -782,7 +785,7 @@ namespace Spine.Unity.Editor { + "b) switch to Gamma color space via\nProject Settings - Player - Other Settings - Color Space.\n", atlasAsset.name), atlasAsset); } - } else if (SpineEditorUtilities.Preferences.UsesPMAWorkflow != isPMA) { + } else if (isFirstImport && SpineEditorUtilities.Preferences.UsesPMAWorkflow != isPMA) { bool wasFixed = false; if (SpineEditorUtilities.Preferences.ShowWorkflowMismatchDialog) wasFixed = ShowWorkflowMismatchDialog(atlasAsset, isLinearPMAMismatch: false, atlasIsPMA: isPMA); diff --git a/spine-unity/Assets/Spine/package.json b/spine-unity/Assets/Spine/package.json index a38ff10ca..403959a69 100644 --- a/spine-unity/Assets/Spine/package.json +++ b/spine-unity/Assets/Spine/package.json @@ -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.8", + "version": "4.3.9", "unity": "2018.3", "author": { "name": "Esoteric Software",