Quellcode durchsuchen

[unity] Fixed `GetRepackedSkin()` ignoring `mipmaps` argument. Closes #1582.

Harald Csaszar vor 5 Jahren
Ursprung
Commit
12897260d7

+ 4 - 2
spine-unity/Assets/Spine/Runtime/spine-unity/Utility/AtlasUtilities.cs

@@ -250,7 +250,7 @@ namespace Spine.Unity.AttachmentTools {
 						regionIndexes.Add(existingIndex); // Store the region index for the eventual new attachment.
 						regionIndexes.Add(existingIndex); // Store the region index for the eventual new attachment.
 					} else {
 					} else {
 						originalRegions.Add(region);
 						originalRegions.Add(region);
-						texturesToPack.Add(region.ToTexture()); // Add the texture to the PackTextures argument
+						texturesToPack.Add(region.ToTexture(mipmaps : mipmaps)); // Add the texture to the PackTextures argument
 						existingRegions.Add(region, newRegionIndex); // Add the region to the dictionary of known regions
 						existingRegions.Add(region, newRegionIndex); // Add the region to the dictionary of known regions
 						regionIndexes.Add(newRegionIndex); // Store the region index for the eventual new attachment.
 						regionIndexes.Add(newRegionIndex); // Store the region index for the eventual new attachment.
 						newRegionIndex++;
 						newRegionIndex++;
@@ -377,7 +377,9 @@ namespace Spine.Unity.AttachmentTools {
 					} else {
 					} else {
 						originalRegions.Add(region);
 						originalRegions.Add(region);
 						for (int i = 0; i < numTextureParamsToRepack; ++i) {
 						for (int i = 0; i < numTextureParamsToRepack; ++i) {
-							Texture2D regionTexture = (i == 0 ? region.ToTexture() : region.ToTexture(texturePropertyId : additionalTexturePropertyIDsToCopy[i - 1]));
+							Texture2D regionTexture = (i == 0 ?
+								region.ToTexture(mipmaps : mipmaps) :
+								region.ToTexture(mipmaps : mipmaps, texturePropertyId : additionalTexturePropertyIDsToCopy[i - 1]));
 							texturesToPackAtParam[i].Add(regionTexture); // Add the texture to the PackTextures argument
 							texturesToPackAtParam[i].Add(regionTexture); // Add the texture to the PackTextures argument
 						}
 						}
 						existingRegions.Add(region, newRegionIndex); // Add the region to the dictionary of known regions
 						existingRegions.Add(region, newRegionIndex); // Add the region to the dictionary of known regions