فهرست منبع

[unity] Handle case where 0 textures are repacked.

pharan 6 سال پیش
والد
کامیت
3331d30eae
1فایلهای تغییر یافته به همراه4 افزوده شده و 1 حذف شده
  1. 4 1
      spine-unity/Assets/Spine/Runtime/spine-unity/Modules/AttachmentTools/AttachmentTools.cs

+ 4 - 1
spine-unity/Assets/Spine/Runtime/spine-unity/Modules/AttachmentTools/AttachmentTools.cs

@@ -438,8 +438,11 @@ namespace Spine.Unity.Modules.AttachmentTools {
 			// Fill a new texture with the collected attachment textures.
 			var newTexture = new Texture2D(maxAtlasSize, maxAtlasSize, textureFormat, mipmaps);
 			newTexture.mipMapBias = AtlasUtilities.DefaultMipmapBias;
-			newTexture.anisoLevel = texturesToPack[0].anisoLevel;
 			newTexture.name = newAssetName;
+			// Copy settings
+			if (texturesToPack.Count > 0) {
+				newTexture.anisoLevel = texturesToPack[0].anisoLevel;
+			}
 			var rects = newTexture.PackTextures(texturesToPack.ToArray(), padding, maxAtlasSize);
 
 			// Rehydrate the repacked textures as a Material, Spine atlas and Spine.AtlasAttachments