Browse Source

[unity] Fixed `Atlas source cannot be null!` upon jpg import in Unity 2022.2. Closes #2237.

Harald Csaszar 2 years ago
parent
commit
be983ac413

+ 1 - 1
spine-unity/Assets/Spine/Editor/spine-unity/Editor/Utility/AssetUtility.cs

@@ -497,7 +497,7 @@ namespace Spine.Unity.Editor {
 
 
 		static void AddDependentAtlasIfImageChanged (List<string> atlasPaths, List<string> imagePaths) {
 		static void AddDependentAtlasIfImageChanged (List<string> atlasPaths, List<string> imagePaths) {
 			foreach (string imagePath in imagePaths) {
 			foreach (string imagePath in imagePaths) {
-				string atlasPath = imagePath.Replace(".png", ".atlas.txt");
+				string atlasPath = Path.ChangeExtension(imagePath, ".atlas.txt");
 				if (!System.IO.File.Exists(atlasPath))
 				if (!System.IO.File.Exists(atlasPath))
 					continue;
 					continue;