diff --git a/Assets/LDtkUnity/Editor/ScriptedImporter/LDtkTilesetImporter.cs b/Assets/LDtkUnity/Editor/ScriptedImporter/LDtkTilesetImporter.cs index e33b446b..583009a5 100644 --- a/Assets/LDtkUnity/Editor/ScriptedImporter/LDtkTilesetImporter.cs +++ b/Assets/LDtkUnity/Editor/ScriptedImporter/LDtkTilesetImporter.cs @@ -10,7 +10,7 @@ using UnityEngine.Tilemaps; using Debug = UnityEngine.Debug; -#if LDTK_UNITY_ASEPRITE +#if LDTK_UNITY_ASEPRITE && UNITY_2021_3_OR_NEWER using UnityEditor.U2D.Aseprite; #endif @@ -61,7 +61,7 @@ internal sealed partial class LDtkTilesetImporter : LDtkJsonImporter(PathToTexture(assetPath)); @@ -628,7 +628,7 @@ private Texture2D GenerateTextureFromAseprite(Sprite sprite) private TextureImporterPlatformSettings GetTextureImporterPlatformSettings() { -#if LDTK_UNITY_ASEPRITE +#if LDTK_UNITY_ASEPRITE && UNITY_2021_3_OR_NEWER if (_srcAsepriteImporter) { return _srcAsepriteImporter.GetImporterPlatformSettings(EditorUserBuildSettings.activeBuildTarget); @@ -708,7 +708,7 @@ private bool CacheTextureImporterOrAsepriteImporter() //Then check aseprite if (LDtkRelativeGetterTilesetTexture.IsAsepriteAsset(path)) { -#if LDTK_UNITY_ASEPRITE +#if LDTK_UNITY_ASEPRITE && UNITY_2021_3_OR_NEWER _srcAsepriteImporter = (AsepriteImporter)GetAtPath(path); if (_srcAsepriteImporter == null) { @@ -801,7 +801,7 @@ private void ForceUpdateSpriteDataName(SpriteRect spr) private static readonly int[] MaxSizes = new[] { 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384 }; private bool HasTextureIssue(TextureImporterPlatformSettings platformSettings) { -#if LDTK_UNITY_ASEPRITE +#if LDTK_UNITY_ASEPRITE && UNITY_2021_3_OR_NEWER AssetImporter importer = _srcAsepriteImporter != null ? (AssetImporter)_srcAsepriteImporter : _srcTextureImporter; #else AssetImporter importer = _srcTextureImporter; diff --git a/Assets/LDtkUnity/Samples~/Samples/atlas/NuclearBlaze_by_deepnight.aseprite.meta b/Assets/LDtkUnity/Samples~/Samples/atlas/NuclearBlaze_by_deepnight.aseprite.meta index accd4c92..63901fd2 100644 --- a/Assets/LDtkUnity/Samples~/Samples/atlas/NuclearBlaze_by_deepnight.aseprite.meta +++ b/Assets/LDtkUnity/Samples~/Samples/atlas/NuclearBlaze_by_deepnight.aseprite.meta @@ -1,7 +1,194 @@ fileFormatVersion: 2 guid: 4a4023b866017a940b15838d7aee8661 -DefaultImporter: +ScriptedImporter: + internalIDToNameTable: [] externalObjects: {} + serializedVersion: 2 userData: assetBundleName: assetBundleVariant: + script: {fileID: 11500000, guid: 62a9f0aa5b59740cfbadc7e5f9823bb0, type: 3} + textureImporterSettings: + alphaSource: 1 + mipMapMode: 0 + enableMipMap: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + convertToNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + swizzle: 50462976 + isReadable: 1 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + nPOTScale: 1 + sRGBTexture: 1 + spriteMode: 2 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 0 + flipbookColumns: 0 + ignorePngGamma: 0 + cookieMode: 0 + filterMode: 0 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 1 + normalMap: 0 + textureFormat: 0 + maxTextureSize: 0 + lightmap: 0 + compressionQuality: 0 + linearTexture: 0 + grayScaleToAlpha: 0 + rGBM: 0 + cubemapConvolutionSteps: 0 + cubemapConvolutionExponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + previousAsepriteImporterSettings: + fileImportMode: 1 + importHiddenLayers: 0 + layerImportMode: 1 + defaultPivotSpace: 0 + defaultPivotAlignment: 7 + customPivotPosition: {x: 0.5, y: 0.5} + mosaicPadding: 4 + spritePadding: 0 + generateModelPrefab: 1 + generateAnimationClips: 1 + addSortingGroup: 1 + addShadowCasters: 0 + asepriteImporterSettings: + fileImportMode: 1 + importHiddenLayers: 0 + layerImportMode: 1 + defaultPivotSpace: 0 + defaultPivotAlignment: 7 + customPivotPosition: {x: 0.5, y: 0.5} + mosaicPadding: 4 + spritePadding: 0 + generateModelPrefab: 1 + generateAnimationClips: 1 + addSortingGroup: 1 + addShadowCasters: 0 + importFileNodeState: 1 + platformSettingsDirtyTick: 638522700485912630 + textureAssetName: + singleSpriteImportData: + - name: + originalName: + pivot: {x: 0, y: 0} + alignment: 0 + border: {x: 0, y: 0, z: 0, w: 0} + customData: + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 0 + height: 0 + spriteID: + spriteBone: [] + spriteOutline: [] + vertices: [] + spritePhysicsOutline: [] + indices: + edges: [] + tessellationDetail: 0 + uvTransform: {x: 0, y: 0} + animatedSpriteImportData: + - name: NuclearBlaze_by_deepnight + originalName: + pivot: {x: 0.94736844, y: -1.125} + alignment: 9 + border: {x: 0, y: 0, z: 0, w: 0} + customData: + rect: + serializedVersion: 2 + x: 4 + y: 4 + width: 304 + height: 256 + spriteID: 2c637c92bfceefd42b6795113f8acdb8 + spriteBone: [] + spriteOutline: [] + vertices: [] + spritePhysicsOutline: [] + indices: + edges: [] + tessellationDetail: 0 + uvTransform: {x: 4, y: 4} + spriteSheetImportData: [] + asepriteLayers: + - layerIndex: 0 + guid: -1222202775 + name: NuclearBlaze_by_deepnight + layerFlags: 0 + layerType: 0 + blendMode: 0 + cells: + - name: NuclearBlaze_by_deepnight + frameIndex: 0 + additiveSortOrder: 0 + cellRect: + x: 0 + y: 288 + width: 304 + height: 256 + spriteId: 2c637c92bfceefd42b6795113f8acdb8 + linkedCells: [] + parentIndex: -1 + platformSettings: + - name: DefaultTexturePlatform + overridden: 0 + ignorePlatformSupport: 0 + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: 4 + textureCompression: 0 + compressionQuality: 50 + forceMaximumCompressionQuality_BC6H_BC7: 0 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + androidETC2FallbackOverride: 0 + - name: Standalone + overridden: 0 + ignorePlatformSupport: 0 + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + forceMaximumCompressionQuality_BC6H_BC7: 0 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + androidETC2FallbackOverride: 0 + generatePhysicsShape: 0 + secondarySpriteTextures: [] + spritePackingTag: + canvasSize: {x: 576, y: 544} diff --git a/Assets/LDtkUnity/Samples~/Samples/atlas/classicAutoTiles.aseprite.meta b/Assets/LDtkUnity/Samples~/Samples/atlas/classicAutoTiles.aseprite.meta index b0b38b0b..5e4bcced 100644 --- a/Assets/LDtkUnity/Samples~/Samples/atlas/classicAutoTiles.aseprite.meta +++ b/Assets/LDtkUnity/Samples~/Samples/atlas/classicAutoTiles.aseprite.meta @@ -1,7 +1,170 @@ fileFormatVersion: 2 guid: c41c36c0f42ab2b428d2bfd86d894f38 -DefaultImporter: +ScriptedImporter: + internalIDToNameTable: [] externalObjects: {} + serializedVersion: 2 userData: assetBundleName: assetBundleVariant: + script: {fileID: 11500000, guid: 62a9f0aa5b59740cfbadc7e5f9823bb0, type: 3} + textureImporterSettings: + alphaSource: 1 + mipMapMode: 0 + enableMipMap: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + convertToNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + swizzle: 50462976 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + nPOTScale: 1 + sRGBTexture: 1 + spriteMode: 2 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 0 + flipbookColumns: 0 + ignorePngGamma: 0 + cookieMode: 0 + filterMode: 0 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 1 + normalMap: 0 + textureFormat: 0 + maxTextureSize: 0 + lightmap: 0 + compressionQuality: 0 + linearTexture: 0 + grayScaleToAlpha: 0 + rGBM: 0 + cubemapConvolutionSteps: 0 + cubemapConvolutionExponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + previousAsepriteImporterSettings: + fileImportMode: 1 + importHiddenLayers: 0 + layerImportMode: 1 + defaultPivotSpace: 0 + defaultPivotAlignment: 7 + customPivotPosition: {x: 0.5, y: 0.5} + mosaicPadding: 4 + spritePadding: 0 + generateModelPrefab: 1 + generateAnimationClips: 1 + addSortingGroup: 1 + addShadowCasters: 0 + asepriteImporterSettings: + fileImportMode: 1 + importHiddenLayers: 0 + layerImportMode: 1 + defaultPivotSpace: 0 + defaultPivotAlignment: 7 + customPivotPosition: {x: 0.5, y: 0.5} + mosaicPadding: 4 + spritePadding: 0 + generateModelPrefab: 1 + generateAnimationClips: 1 + addSortingGroup: 1 + addShadowCasters: 0 + importFileNodeState: 1 + platformSettingsDirtyTick: 0 + textureAssetName: + singleSpriteImportData: + - name: + originalName: + pivot: {x: 0, y: 0} + alignment: 0 + border: {x: 0, y: 0, z: 0, w: 0} + customData: + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 0 + height: 0 + spriteID: + spriteBone: [] + spriteOutline: [] + vertices: [] + spritePhysicsOutline: [] + indices: + edges: [] + tessellationDetail: 0 + uvTransform: {x: 0, y: 0} + animatedSpriteImportData: + - name: classicAutoTiles + originalName: + pivot: {x: 1.4545455, y: -1.8750001} + alignment: 9 + border: {x: 0, y: 0, z: 0, w: 0} + customData: + rect: + serializedVersion: 2 + x: 4 + y: 4 + width: 176 + height: 80 + spriteID: da7569d2aa6bf76489e893eb68adcd1a + spriteBone: [] + spriteOutline: [] + vertices: [] + spritePhysicsOutline: [] + indices: + edges: [] + tessellationDetail: 0 + uvTransform: {x: 4, y: 4} + spriteSheetImportData: [] + asepriteLayers: + - layerIndex: 0 + guid: 530099994 + name: classicAutoTiles + layerFlags: 0 + layerType: 0 + blendMode: 0 + cells: + - name: classicAutoTiles + frameIndex: 0 + additiveSortOrder: 0 + cellRect: + x: 0 + y: 150 + width: 176 + height: 80 + spriteId: da7569d2aa6bf76489e893eb68adcd1a + linkedCells: [] + parentIndex: -1 + platformSettings: [] + generatePhysicsShape: 0 + secondarySpriteTextures: [] + spritePackingTag: + canvasSize: {x: 512, y: 230} diff --git a/Packages/manifest.json b/Packages/manifest.json index 193d5420..5c56e3b9 100644 --- a/Packages/manifest.json +++ b/Packages/manifest.json @@ -2,6 +2,7 @@ "dependencies": { "com.needle.compilation-visualizer": "https://github.com/needle-tools/compilation-visualizer.git", "com.quickeye.icon-browser": "https://github.com/ErnSur/unity-editor-icons.git", + "com.unity.2d.aseprite": "1.1.4", "com.unity.2d.sprite": "1.0.0", "com.unity.2d.tilemap": "1.0.0", "com.unity.ide.rider": "3.0.28", diff --git a/Packages/packages-lock.json b/Packages/packages-lock.json index 0aa02e73..a2c88500 100644 --- a/Packages/packages-lock.json +++ b/Packages/packages-lock.json @@ -14,6 +14,31 @@ "dependencies": {}, "hash": "07434fccd016a2fabab284e0aff30a592881c318" }, + "com.unity.2d.aseprite": { + "version": "1.1.4", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.2d.sprite": "1.0.0", + "com.unity.2d.common": "6.0.6", + "com.unity.mathematics": "1.2.6", + "com.unity.modules.animation": "1.0.0" + }, + "url": "https://packages.unity.com" + }, + "com.unity.2d.common": { + "version": "9.0.4", + "depth": 1, + "source": "registry", + "dependencies": { + "com.unity.2d.sprite": "1.0.0", + "com.unity.mathematics": "1.1.0", + "com.unity.modules.uielements": "1.0.0", + "com.unity.modules.animation": "1.0.0", + "com.unity.burst": "1.8.4" + }, + "url": "https://packages.unity.com" + }, "com.unity.2d.sprite": { "version": "1.0.0", "depth": 0, @@ -29,6 +54,16 @@ "com.unity.modules.uielements": "1.0.0" } }, + "com.unity.burst": { + "version": "1.8.13", + "depth": 2, + "source": "registry", + "dependencies": { + "com.unity.mathematics": "1.2.1", + "com.unity.modules.jsonserialize": "1.0.0" + }, + "url": "https://packages.unity.com" + }, "com.unity.ext.nunit": { "version": "2.0.5", "depth": 1, @@ -54,6 +89,13 @@ }, "url": "https://packages.unity.com" }, + "com.unity.mathematics": { + "version": "1.3.1", + "depth": 1, + "source": "registry", + "dependencies": {}, + "url": "https://packages.unity.com" + }, "com.unity.settings-manager": { "version": "2.0.1", "depth": 1,