mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 01:36:02 +08:00
[unity] Handle case where 0 textures are repacked.
This commit is contained in:
parent
2aa5685c9a
commit
3331d30eae
@ -438,8 +438,11 @@ namespace Spine.Unity.Modules.AttachmentTools {
|
|||||||
// Fill a new texture with the collected attachment textures.
|
// Fill a new texture with the collected attachment textures.
|
||||||
var newTexture = new Texture2D(maxAtlasSize, maxAtlasSize, textureFormat, mipmaps);
|
var newTexture = new Texture2D(maxAtlasSize, maxAtlasSize, textureFormat, mipmaps);
|
||||||
newTexture.mipMapBias = AtlasUtilities.DefaultMipmapBias;
|
newTexture.mipMapBias = AtlasUtilities.DefaultMipmapBias;
|
||||||
newTexture.anisoLevel = texturesToPack[0].anisoLevel;
|
|
||||||
newTexture.name = newAssetName;
|
newTexture.name = newAssetName;
|
||||||
|
// Copy settings
|
||||||
|
if (texturesToPack.Count > 0) {
|
||||||
|
newTexture.anisoLevel = texturesToPack[0].anisoLevel;
|
||||||
|
}
|
||||||
var rects = newTexture.PackTextures(texturesToPack.ToArray(), padding, maxAtlasSize);
|
var rects = newTexture.PackTextures(texturesToPack.ToArray(), padding, maxAtlasSize);
|
||||||
|
|
||||||
// Rehydrate the repacked textures as a Material, Spine atlas and Spine.AtlasAttachments
|
// Rehydrate the repacked textures as a Material, Spine atlas and Spine.AtlasAttachments
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user