From d0770a99cb156e9bcb7865da3702cf2fc0a4eb7e Mon Sep 17 00:00:00 2001 From: Harald Csaszar Date: Thu, 28 Apr 2022 18:18:11 +0200 Subject: [PATCH] [unity] Fixed automatic partial re-import when atlas png texture and/or material have been deleted and re-exported. Closes #1650. --- .../spine-unity/Editor/Utility/AssetUtility.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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 92c4d41cf..db0a0112e 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 @@ -349,6 +349,8 @@ namespace Spine.Unity.Editor { } } + AddDependentAtlasIfImageChanged(atlasPaths, imagePaths); + // Import atlases first. var newAtlases = new List(); foreach (string ap in atlasPaths) { @@ -453,6 +455,18 @@ namespace Spine.Unity.Editor { } } + static void AddDependentAtlasIfImageChanged (List atlasPaths, List imagePaths) { + foreach (var imagePath in imagePaths) { + string atlasPath = imagePath.Replace(".png", ".atlas.txt"); + if (!System.IO.File.Exists(atlasPath)) + continue; + + if (!atlasPaths.Contains(atlasPath)) { + atlasPaths.Add(atlasPath); + } + } + } + static void AddDependentSkeletonIfAtlasChanged (List skeletonPaths, List atlasPaths) { foreach (var atlasPath in atlasPaths) { string skeletonPathJson = atlasPath.Replace(".atlas.txt", ".json");