diff --git a/spine-unity/Assets/spine-unity/AtlasAsset.cs b/spine-unity/Assets/spine-unity/AtlasAsset.cs index 5ec092ada..a76839407 100644 --- a/spine-unity/Assets/spine-unity/AtlasAsset.cs +++ b/spine-unity/Assets/spine-unity/AtlasAsset.cs @@ -96,8 +96,14 @@ public class MaterialsTextureLoader : TextureLoader { return; } page.rendererObject = material; - page.width = material.mainTexture.width; - page.height = material.mainTexture.height; + + //deal with really, really old atlas files + if (page.width == 0 || page.height == 0) + { + page.width = material.mainTexture.width; + page.height = material.mainTexture.height; + } + } public void Unload (object texture) { diff --git a/spine-unity/Assets/spine-unity/Editor/SpineEditorUtilities.cs b/spine-unity/Assets/spine-unity/Editor/SpineEditorUtilities.cs index e62bff4af..e3afbb71a 100644 --- a/spine-unity/Assets/spine-unity/Editor/SpineEditorUtilities.cs +++ b/spine-unity/Assets/spine-unity/Editor/SpineEditorUtilities.cs @@ -398,8 +398,8 @@ public class SpineEditorUtilities : AssetPostprocessor { TextureImporter texImporter = (TextureImporter)TextureImporter.GetAtPath(texturePath); texImporter.textureFormat = TextureImporterFormat.AutomaticTruecolor; texImporter.mipmapEnabled = false; - //TODO: Get actual size from atlas data texImporter.maxTextureSize = 2048; + EditorUtility.SetDirty(texImporter); AssetDatabase.ImportAsset(texturePath); AssetDatabase.SaveAssets();