diff --git a/CHANGELOG.md b/CHANGELOG.md index 53cda36..7078cf9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,8 @@ # Changelog +## [6.0.8] - 2023-10-25 +### Fixed +- Fixed an issue where PSDImporter atlas size does not follow PVRTC compression format for the iOS platform + ## [6.0.7] - 2022-12-01 ### Fixed - Fixed an issue where the amount of alpha removed from layers would not be re-applied as final position offset of the layers. diff --git a/Editor/PSDImporter.cs b/Editor/PSDImporter.cs index 6984868..7720bce 100644 --- a/Editor/PSDImporter.cs +++ b/Editor/PSDImporter.cs @@ -507,7 +507,10 @@ void ImportFromLayers(AssetImportContext ctx) var layerIndex = new List(); var spriteNameHash = new UniqueNameGenerator(); - + + var platformSettings = GetPlatformTextureSettings(ctx.selectedBuildTarget); + bool requireSquarePOT = (TextureImporterFormat.PVRTC_RGB2 <= platformSettings.format && platformSettings.format <= TextureImporterFormat.PVRTC_RGBA4); + var oldPsdLayers = GetPSDLayers(); List psdLayers = null; try @@ -562,7 +565,7 @@ void ImportFromLayers(AssetImportContext ctx) } const int padding = 4; - ImagePacker.Pack(layerBuffers.ToArray(), layerWidth.ToArray(), layerHeight.ToArray(), padding, out output, out int width, out int height, out RectInt[] spriteData, out Vector2Int[] uvTransform); + ImagePacker.Pack(layerBuffers.ToArray(), layerWidth.ToArray(), layerHeight.ToArray(), padding, out output, out int width, out int height, out RectInt[] spriteData, out Vector2Int[] uvTransform, requireSquarePOT); var packOffsets = new Vector2[spriteData.Length]; for (var i = 0; i < packOffsets.Length; ++i) diff --git a/package.json b/package.json index a5f686c..f8ea74f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "com.unity.2d.psdimporter", - "version": "6.0.7", + "version": "6.0.8", "unity": "2021.2", "unityRelease": "7f1", "displayName": "2D PSD Importer", @@ -12,20 +12,23 @@ ], "category": "2D", "dependencies": { - "com.unity.2d.animation": "7.0.9", - "com.unity.2d.common": "6.0.6", + "com.unity.2d.animation": "7.0.13", + "com.unity.2d.common": "6.0.7", "com.unity.2d.sprite": "1.0.0" }, "relatedPackages": { - "com.unity.2d.psdimporter.tests": "6.0.7" + "com.unity.2d.psdimporter.tests": "6.0.8" + }, + "_upm": { + "changelog": "### Fixed\n- Fixed an issue where PSDImporter atlas size does not follow PVRTC compression format for the iOS platform" }, "upmCi": { - "footprint": "7d4f681e80410f174a7f368ce8f1ca173091ba92" + "footprint": "26fb4e88d2fa9a182c2864b9a45d88ce5d1477a5" }, "documentationUrl": "https://docs.unity3d.com/Packages/com.unity.2d.psdimporter@6.0/manual/index.html", "repository": { "url": "https://github.cds.internal.unity3d.com/unity/2d.git", "type": "git", - "revision": "911204bb63dcf2da80b6063d54c4ec8737ad13dc" + "revision": "681660f0ddc6412f1c6ffdc2f6433c5cc5adbe06" } }