[Unity Bugfix] Fixed auto 2048x2048 import and now check for ancient atlas page size == 0

This commit is contained in:
Fenrisul 2014-09-30 16:39:03 -07:00
parent bbb27ee2e3
commit b02e4acabf
2 changed files with 9 additions and 3 deletions

View File

@ -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) {

View File

@ -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();