mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 01:36:02 +08:00
Merge pull request #307 from Fenrisul/master
[Unity Bugfix] Fixed auto 2048x2048 import
This commit is contained in:
commit
c79fe82ef8
@ -96,8 +96,14 @@ public class MaterialsTextureLoader : TextureLoader {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
page.rendererObject = material;
|
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) {
|
public void Unload (object texture) {
|
||||||
|
|||||||
@ -398,8 +398,8 @@ public class SpineEditorUtilities : AssetPostprocessor {
|
|||||||
TextureImporter texImporter = (TextureImporter)TextureImporter.GetAtPath(texturePath);
|
TextureImporter texImporter = (TextureImporter)TextureImporter.GetAtPath(texturePath);
|
||||||
texImporter.textureFormat = TextureImporterFormat.AutomaticTruecolor;
|
texImporter.textureFormat = TextureImporterFormat.AutomaticTruecolor;
|
||||||
texImporter.mipmapEnabled = false;
|
texImporter.mipmapEnabled = false;
|
||||||
//TODO: Get actual size from atlas data
|
|
||||||
texImporter.maxTextureSize = 2048;
|
texImporter.maxTextureSize = 2048;
|
||||||
|
|
||||||
EditorUtility.SetDirty(texImporter);
|
EditorUtility.SetDirty(texImporter);
|
||||||
AssetDatabase.ImportAsset(texturePath);
|
AssetDatabase.ImportAsset(texturePath);
|
||||||
AssetDatabase.SaveAssets();
|
AssetDatabase.SaveAssets();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user