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 7aa4232c1..99511a83b 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 @@ -341,7 +341,7 @@ namespace Spine.Unity.Editor { public static void ImportSpineContent (string[] imported, List texturesWithoutMetaFile, bool reimport = false) { - + isFirstPMAWorkflowMismatch = true; List atlasPaths = new List(); List imagePaths = new List(); @@ -391,17 +391,20 @@ namespace Spine.Unity.Editor { } } } - AddDependentAtlasIfImageChanged(atlasPaths, imagePaths); + List dependentAtlasPaths = new List(); + AddDependentAtlasIfImageChanged(dependentAtlasPaths, imagePaths); + atlasPaths.AddRange(dependentAtlasPaths); // Import atlases first. List newAtlases = new List(); - foreach (string ap in atlasPaths) { + foreach (string atlasPath in atlasPaths) { #if PROBLEMATIC_PACKAGE_ASSET_MODIFICATION if (ap.StartsWith("Packages")) continue; #endif - TextAsset atlasText = AssetDatabase.LoadAssetAtPath(ap); - AtlasAssetBase atlas = IngestSpineAtlas(atlasText, texturesWithoutMetaFile); + TextAsset atlasText = AssetDatabase.LoadAssetAtPath(atlasPath); + bool isExistingAtlas = dependentAtlasPaths.Contains(atlasPath); + AtlasAssetBase atlas = IngestSpineAtlas(atlasText, texturesWithoutMetaFile, isExistingAtlas); newAtlases.Add(atlas); } AddDependentSkeletonIfAtlasChanged(skeletonPaths, atlasPaths); @@ -638,7 +641,9 @@ namespace Spine.Unity.Editor { return arr; } - static AtlasAssetBase IngestSpineAtlas (TextAsset atlasText, List texturesWithoutMetaFile) { + static AtlasAssetBase IngestSpineAtlas (TextAsset atlasText, List texturesWithoutMetaFile, + bool isExistingAtlas) { + if (atlasText == null) { Debug.LogWarning("Atlas source cannot be null!"); return null; @@ -650,15 +655,12 @@ namespace Spine.Unity.Editor { string atlasPath = assetPath + "/" + primaryName + AtlasSuffix + ".asset"; SpineAtlasAsset atlasAsset = (SpineAtlasAsset)AssetDatabase.LoadAssetAtPath(atlasPath, typeof(SpineAtlasAsset)); + bool isNewAtlas = !isExistingAtlas && atlasAsset == null; List vestigialMaterials = new List(); - - bool isNewAtlas; if (atlasAsset == null) { - isNewAtlas = true; atlasAsset = SpineAtlasAsset.CreateInstance(); } else { - isNewAtlas = false; foreach (Material m in atlasAsset.materials) vestigialMaterials.Add(m); } diff --git a/spine-unity/Assets/Spine/package.json b/spine-unity/Assets/Spine/package.json index a39c01145..25f323470 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.10", + "version": "4.3.11", "unity": "2018.3", "author": { "name": "Esoteric Software",