[
  {
    "path": ".github/FUNDING.yml",
    "content": "# These are supported funding model platforms\n\ngithub: martinhodler # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]\npatreon: tinuio # Replace with a single Patreon username\nopen_collective: # Replace with a single Open Collective username\nko_fi: # Replace with a single Ko-fi username\ntidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel\ncommunity_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry\nliberapay: # Replace with a single Liberapay username\nissuehunt: # Replace with a single IssueHunt username\notechie: # Replace with a single Otechie username\ncustom: 'https://www.paypal.me/martinhodler' # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/bug_report.md",
    "content": "---\nname: Bug report\nabout: Create a report to help us improve\n\n---\n\n**Describe the bug**\nA clear and concise description of what the bug is.\n\n**To Reproduce**\nSteps to reproduce the behavior:\n1. Go to '...'\n2. Click on '....'\n3. Scroll down to '....'\n4. See error\n\n**Expected behavior**\nA clear and concise description of what you expected to happen.\n\n**Screenshots**\nIf applicable, add screenshots to help explain your problem.\n\n**Desktop (please complete the following information):**\n - OS: [e.g. Windows 10]\n - Version [e.g. 2018.2]\n\n**Additional context**\nAdd any other context about the problem here.\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/feature_request.md",
    "content": "---\nname: Feature request\nabout: Suggest an idea for this project\n\n---\n\n**Is your feature request related to a problem? Please describe.**\nA clear and concise description of what the problem is. Ex. I'm always frustrated when [...]\n\n**Describe the solution you'd like**\nA clear and concise description of what you want to happen.\n\n**Describe alternatives you've considered**\nA clear and concise description of any alternative solutions or features you've considered.\n\n**Additional context**\nAdd any other context or screenshots about the feature request here.\n"
  },
  {
    "path": ".gitignore",
    "content": "[Ll]ibrary/\n[Tt]emp/\n[Oo]bj/\n[Bb]uild/\n[Bb]uilds/\nAssets/AssetStoreTools*\n\n# Visual Studio cache directory\n.vs/\n\n# Autogenerated VS/MD/Consulo solution and project files\nExportedObj/\n.consulo/\n*.csproj\n*.unityproj\n*.sln\n*.suo\n*.tmp\n*.user\n*.userprefs\n*.pidb\n*.booproj\n*.svd\n*.pdb\n*.opendb\n\n# Unity3D generated meta files\n*.pidb.meta\n*.pdb.meta\n\n# Unity3D Generated File On Crash Reports\nsysinfo.txt\n\n# Builds\n*.apk\n*.unitypackage"
  },
  {
    "path": "CHANGELOG.md",
    "content": "# Changelog\nAll notable changes to this project will be documented in this file.\n\nThe format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),\nand this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).\n\n## [1.0.4] - 2021-01-19\n### Added\n- Dependency for the Unity 2D Sprite in package.json\n- Support for OpenUPM\n\n## [1.0.3] - 2020-12-28\n### Added\n- Support for different import implementations\n- Bundled Importer to keep the imported sprites and animations in one file\n- Support for the sprite-editor with the Bundled Importer\n\n### Changed\n- The regular import was labelled \"Generated\" because it generates the content and creates new assets in a subfolder \n\n## [1.0.2] - 2020-12-28\n### Added\n- Creates a sprite sheet file (not dynamic)\n- Editable meta data like custom physics shapes with the 'Sprite Editor'\n- Generates tilemap with extended-padding (solves lines tearing issue between tiles)\n- Makes animation files (not dynamic)\n- Animation controller creation\n- New tilemap name rule support (row-col)\n\n### Changed\n- Creates multiple assets instead of one single bundle\n\n## [1.0.1] - 2020-02-04\n### Added\n- Transparent color option\n- Tilemap empty behaviour\n\n### Changed\n- Support for Unity package manager was fixed\n\n## [1.0.0] - 2018-11-05\n### Added\n- Different Import Modes (Sprite, Tilemap)\n- Auto-Sprite creation"
  },
  {
    "path": "CHANGELOG.md.meta",
    "content": "fileFormatVersion: 2\nguid: 40f530ba8f002934598a77a51266d26f\nTextScriptImporter:\n  externalObjects: {}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "Editor/AseFileImporter.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing UnityEngine;\nusing System.IO;\nusing System.Linq;\nusing Aseprite;\nusing AsepriteImporter.Data;\nusing AsepriteImporter.DataProviders;\nusing AsepriteImporter.Editors;\nusing AsepriteImporter.Importers;\nusing AsepriteImporter.Settings;\nusing UnityEditor;\nusing UnityEditor.U2D.Sprites;\nusing Object = UnityEngine.Object;\n\n#if UNITY_2020_2_OR_NEWER\nusing UnityEditor.AssetImporters;\n#else\nusing UnityEditor.Experimental.AssetImporters;\n#endif\n\n\n\nnamespace AsepriteImporter {\n    [ScriptedImporter(1, new[] {\"ase\", \"aseprite\"})]\n    public class AseFileImporter : ScriptedImporter, ISpriteEditorDataProvider {\n        [SerializeField] public AseFileImportSettings settings = new AseFileImportSettings();\n        [SerializeField] public AseFileTextureImportSettings textureImporterSettings = new AseFileTextureImportSettings();\n        [SerializeField] public AseFileAnimationSettings[] animationSettings = new AseFileAnimationSettings[0];\n        \n        [SerializeField] internal Texture2D texture;\n        [SerializeField] internal AseFileSpriteImportData[] spriteImportData;\n        [SerializeField] internal SpriteRect[] spriteRects;\n        \n        [SerializeField] internal int selectedImporter;\n\n        private List<ImporterVariant> importerVariants = new List<ImporterVariant>();\n\n        public Texture2D Texture => texture;\n        public AseFileSpriteImportData[] SpriteImportData => spriteImportData;\n        \n        public ImporterVariant SelectedImporter\n        {\n            get\n            {\n                if (selectedImporter >= 0 && selectedImporter < importerVariants.Count)\n                    return importerVariants[selectedImporter];\n                else\n                {\n                    selectedImporter = 0;\n                    return importerVariants[selectedImporter];\n                }\n            }\n        }\n\n        public SpriteImporter CurrentImporter\n        {\n            get\n            {\n                switch (settings.importType)\n                {\n                    case AseFileImportType.Sprite:\n                        return SelectedImporter.SpriteImporter;\n                    case AseFileImportType.Tileset:\n                        return SelectedImporter.TileSetImporter;\n                }\n\n                return SelectedImporter.SpriteImporter;\n            }\n        }\n\n        public string[] ImporterNames\n        {\n            get\n            {\n                string[] names = new string[importerVariants.Count];\n                for (int i = 0; i < names.Length; ++i)\n                    names[i] = importerVariants[i].Name;\n\n                return names;\n            }\n        }\n\n        public AseFileImporter()\n        {\n            var generatedImporter = new ImporterVariant(\"Generated (Subfolders)\", new GeneratedSpriteImporter(this), new GeneratedTileImporter(this), new GeneratedImporterEditor());\n            var bundledImporter = new ImporterVariant(\"Bundled (preview)\", new BundledSpriteImporter(this), new GeneratedTileImporter(this), new BundledImporterEditor());\n            \n            importerVariants.Add(generatedImporter);\n            importerVariants.Add(bundledImporter);\n        }\n\n        public override void OnImportAsset(AssetImportContext ctx)\n        {\n            texture = null;\n            \n            name = GetFileName(ctx.assetPath);\n            AseFile file = ReadAseFile(ctx.assetPath);\n\n            CurrentImporter.Import(ctx, file);\n\n            CleanUp();\n        }\n\n        private void CleanUp()\n        {\n            bool clearSprites = CurrentImporter.Sprites == null;\n            \n            foreach (var animationSetting in animationSettings)\n            {\n                for (int i = 0; i < animationSetting.sprites.Length; ++i)\n                {\n                    if (clearSprites)\n                    {\n                        animationSetting.sprites[i] = null;\n                        continue;\n                    }\n                    \n                    if (!CurrentImporter.Sprites.Contains(animationSetting.sprites[i]))\n                        animationSetting.sprites[i] = null;\n                }\n            }\n        }\n\n        private string GetFileName(string assetPath) {\n            var parts = assetPath.Split('/');\n            var filename = parts[parts.Length - 1];\n            return filename.Substring(0, filename.LastIndexOf('.'));\n        }\n     \n        private static AseFile ReadAseFile(string assetPath) {\n            var fileStream = new FileStream(assetPath, FileMode.Open, FileAccess.Read);\n            var aseFile = new AseFile(fileStream);\n            fileStream.Close();\n            return aseFile;\n        }\n        \n        \n        \n        #region ISpriteEditorDataProvider implementation\n\n        private AsepriteTextureDataProvider textureDataProvider;\n        private AsepriteOutlineDataProvider outlineDataProvider;\n        \n        \n        public SpriteRect[] GetSpriteRects()\n        {\n            List<SpriteRect> spriteRects = new List<SpriteRect>();\n\n            foreach (AseFileSpriteImportData importData in SpriteImportData)\n            {\n                spriteRects.Add(new SpriteRect()\n                {\n                    spriteID = ConvertStringToGUID(importData.spriteID),\n                    alignment = importData.alignment,\n                    border = importData.border,\n                    name = importData.name,\n                    pivot = importData.pivot,\n                    rect = importData.rect\n                });\n            }\n\n            this.spriteRects = spriteRects.ToArray();\n            return this.spriteRects;\n        }\n\n        public void SetSpriteRects(SpriteRect[] spriteRects)\n        {\n            this.spriteRects = spriteRects;\n        }\n\n        public void Apply()\n        {\n            CurrentImporter.Apply();\n        }\n\n        public void InitSpriteEditorDataProvider()\n        {\n            textureDataProvider = new AsepriteTextureDataProvider(this);\n            outlineDataProvider = new AsepriteOutlineDataProvider(this);\n        }\n\n        public T GetDataProvider<T>() where T : class\n        {\n            if (typeof(T) == typeof(ITextureDataProvider))\n                return textureDataProvider as T;\n\n            if (typeof(T) == typeof(ISpriteOutlineDataProvider))\n                return outlineDataProvider as T;\n\n            if (typeof(T) == typeof(ISpriteEditorDataProvider))\n                return this as T;\n\n            Debug.Log(typeof(T).Name + \" not found\");\n            return null;\n        }\n\n        public bool HasDataProvider(Type type)\n        {\n\n            if (type == typeof(ITextureDataProvider))\n                return true;\n\n            if (type == typeof(ISpriteOutlineDataProvider))\n                return true;\n\n            //Debug.Log(\"Does not support\" + type.Name);\n            return false;\n        }\n\n        public SpriteImportMode spriteImportMode => CurrentImporter.spriteImportMode;\n        public float pixelsPerUnit => CurrentImporter.pixelsPerUnit;\n        public Object targetObject => CurrentImporter.targetObject;\n\n        #endregion\n        \n        \n        private GUID ConvertStringToGUID(string guidString)\n        {\n            if (!GUID.TryParse(guidString, out GUID guid))\n            {\n                guid = GUID.Generate();\n            }\n\n            return guid;\n        }\n    }\n}\n"
  },
  {
    "path": "Editor/AseFileImporter.cs.meta",
    "content": "fileFormatVersion: 2\nguid: d1956ce1ff810451f9738b29e9df561a\nMonoImporter:\n  externalObjects: {}\n  serializedVersion: 2\n  defaultReferences: []\n  executionOrder: 0\n  icon: {instanceID: 0}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "Editor/AseFileImporterEditor.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing AsepriteImporter.Editors;\nusing AsepriteImporter.EditorUtils;\nusing AsepriteImporter.Settings;\nusing UnityEngine;\n#if UNITY_2020_2_OR_NEWER\nusing UnityEditor.AssetImporters;\n#else\nusing UnityEditor.Experimental.AssetImporters;\n#endif\nusing UnityEditor;\n\nnamespace AsepriteImporter {\n    [CustomEditor(typeof(AseFileImporter)), CanEditMultipleObjects]\n    public class AseFileImporterEditor : ScriptedImporterEditor\n    {\n        private SpriteImporterEditor editor;\n        private AseFileImporter importer;\n\n        private int importType;\n        \n        protected readonly string[] importTypes = {\"Sprite\", \"Tileset (Grid)\"};\n\n        internal AseFileImportType ImportType => (AseFileImportType)importType;\n\n        private void ReloadEditor()\n        {\n            if (target is AseFileImporter fileImporter)\n            {\n                importer = fileImporter;\n                editor = importer.SelectedImporter.Editor;\n                editor.Enable(this);\n            }\n        }\n\n        public override void OnEnable()\n        {\n            base.OnEnable();\n            ReloadEditor();\n        }\n\n        public override void OnInspectorGUI()\n        {\n            serializedObject.Update();\n\n\n            string[] importers = importer.ImporterNames;\n            int index = importer.selectedImporter;\n\n            int newIndex = EditorGUILayout.Popup(\"Importer\", index, importers);\n            if (newIndex != index)\n            {\n                importer.selectedImporter = newIndex;\n                ReloadEditor();\n                EditorUtility.SetDirty(importer);\n            }\n            \n            var settings = \"settings.\";\n            var importTypeProperty = serializedObject.FindProperty(settings + \"importType\");\n            importType = importTypeProperty.intValue;\n            \n            EditorGUI.BeginChangeCheck();\n            importType = EditorGUILayout.Popup(\"GenerateSprites Type\", importType, importTypes);\n            if (EditorGUI.EndChangeCheck())\n            {\n                importTypeProperty.intValue = importType;\n            }\n\n            EditorGUILayout.Space();\n\n            if (editor == null)\n                ReloadEditor();\n            \n            if (editor != null)\n                editor.InspectorGUI();\n\n            serializedObject.ApplyModifiedProperties();\n            ApplyRevertGUI();\n        }\n\n        \n\n        internal void CallApplyAndImport()\n        {\n            ApplyAndImport();\n        }\n    }\n}\n"
  },
  {
    "path": "Editor/AseFileImporterEditor.cs.meta",
    "content": "fileFormatVersion: 2\nguid: e3759ef7c1f474c019f281acf979f1a5\nMonoImporter:\n  externalObjects: {}\n  serializedVersion: 2\n  defaultReferences: []\n  executionOrder: 0\n  icon: {instanceID: 0}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "Editor/AseSpritePostProcess.cs",
    "content": "using System.Collections.Generic;\nusing UnityEditor;\n\npublic static class AseSpritePostProcess {\n    public static Dictionary<string, SerializedProperty> GetPhysicsShapeProperties(TextureImporter importer,\n                                                                  List<SpriteMetaData> metaList) {\n        SerializedObject serializedImporter = new SerializedObject(importer);\n        var property = serializedImporter.FindProperty(\"m_SpriteSheet.m_Sprites\");\n        var res = new Dictionary<string, SerializedProperty>();\n        var removed = new HashSet<int>();\n\n        for (int index = 0; index < property.arraySize; index++) {\n            var name = importer.spritesheet[index].name;\n            if (res.ContainsKey(name)) {\n                continue;\n            }\n\n            var element = property.GetArrayElementAtIndex(index);\n            var physicsShape = element.FindPropertyRelative(\"m_PhysicsShape\");\n\n            res.Add(name, physicsShape);\n            removed.Add(index);\n        }\n\n        return res;\n    }\n\n    public static void RecoverPhysicsShapeProperty(\n        Dictionary<string, SerializedProperty> newProperties,\n        Dictionary<string, SerializedProperty> oldProperties) {\n\n        SerializedProperty property = null;\n        foreach (var item in newProperties) {\n            if (!oldProperties.TryGetValue(item.Key, out var oldItem)) {\n                continue;\n            }\n\n            var newItem = item.Value;\n            if (oldItem.arraySize > 0) {\n                newItem.arraySize = oldItem.arraySize;\n\n                for (int index = 0; index < newItem.arraySize; index++) {\n                    var newShape = newItem.GetArrayElementAtIndex(index);\n                    var oldShape = oldItem.GetArrayElementAtIndex(index);\n                    newShape.arraySize = oldShape.arraySize;\n\n                    for (int pi = 0; pi < newShape.arraySize; pi++) {\n                        var newPt = newShape.GetArrayElementAtIndex(pi);\n                        var oldPt = oldShape.GetArrayElementAtIndex(pi);\n                        newPt.vector2Value = oldPt.vector2Value;\n                    }\n                }\n                \n                if (property == null)\n                    property = newItem;\n            }\n        }\n\n        property?.serializedObject.ApplyModifiedPropertiesWithoutUndo();\n    }\n}"
  },
  {
    "path": "Editor/AseSpritePostProcess.cs.meta",
    "content": "fileFormatVersion: 2\nguid: 1e833c76212134f66a27d3bf3c054575\nMonoImporter:\n  externalObjects: {}\n  serializedVersion: 2\n  defaultReferences: []\n  executionOrder: 0\n  icon: {instanceID: 0}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "Editor/Aseprite/AseFile.cs",
    "content": "﻿using Aseprite.Chunks;\nusing Aseprite.Utils;\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text.RegularExpressions;\nusing UnityEditor;\nusing UnityEngine;\n\nnamespace Aseprite\n{\n\n    // See file specs here: https://github.com/aseprite/aseprite/blob/master/docs/ase-file-specs.md\n\n    public class AseFile\n    {\n        public Header Header { get; private set; }\n        public List<Frame> Frames { get; private set; }\n\n        private Dictionary<Type, Chunk> chunkCache = new Dictionary<Type, Chunk>();\n\n        public AseFile(Stream stream)\n        {\n            BinaryReader reader = new BinaryReader(stream);\n            byte[] header = reader.ReadBytes(128);\n\n            Header = new Header(header);\n            Frames = new List<Frame>();\n\n            while (reader.BaseStream.Position < reader.BaseStream.Length)\n            {\n                Frames.Add(new Frame(this, reader));\n            }\n        }\n\n\n        public List<T> GetChunks<T>() where T : Chunk\n        {\n            List<T> chunks = new List<T>();\n\n            for (int i = 0; i < this.Frames.Count; i++)\n            {\n                List<T> cs = this.Frames[i].GetChunks<T>();\n\n                chunks.AddRange(cs);\n            }\n\n            return chunks;\n        }\n\n        public T GetChunk<T>() where T : Chunk\n        {\n            if (!chunkCache.ContainsKey(typeof(T)))\n            {\n                for (int i = 0; i < this.Frames.Count; i++)\n                {\n                    List<T> cs = this.Frames[i].GetChunks<T>();\n\n                    if (cs.Count > 0)\n                    {\n                        chunkCache.Add(typeof(T), cs[0]);\n                        break;\n                    }\n                }\n            }\n\n            return (T)chunkCache[typeof(T)];\n        }\n\n        public Texture2D[] GetFrames()\n        {\n            List<Texture2D> frames = new List<Texture2D>();\n\n            for (int i = 0; i < Frames.Count; i++)\n            {\n                frames.Add(GetFrame(i));\n            }\n\n            return frames.ToArray();\n        }\n\n\n        public Texture2D[] GetLayersAsFrames()\n        {\n            List<Texture2D> frames = new List<Texture2D>();\n            List<LayerChunk> layers = GetChunks<LayerChunk>();\n\n            for (int i = 0; i < layers.Count; i++)\n            {\n                List<Texture2D> layerFrames = GetLayerTexture(i, layers[i]);\n\n                if (layerFrames.Count > 0)\n                    frames.AddRange(layerFrames);\n            }\n\n            return frames.ToArray();\n        }\n\n        private LayerChunk GetParentLayer(LayerChunk layer)\n        {\n            if (layer.LayerChildLevel == 0)\n                return null;\n\n            int childLevel = layer.LayerChildLevel;\n\n            List<LayerChunk> layers = GetChunks<LayerChunk>();\n            int index = layers.IndexOf(layer);\n\n            if (index < 0)\n                return null;\n\n            for (int i = index -1; i > 0; i--)\n            {\n                if (layers[i].LayerChildLevel == layer.LayerChildLevel - 1)\n                    return layers[i];\n            }\n\n            return null;\n        }\n\n        public List<Texture2D> GetLayerTexture(int layerIndex, LayerChunk layer)\n        {\n\n            List<LayerChunk> layers = GetChunks<LayerChunk>();\n            List<Texture2D> textures = new List<Texture2D>();\n\n            for (int frameIndex = 0; frameIndex < Frames.Count; frameIndex++)\n            {\n                Frame frame = Frames[frameIndex];\n                List<CelChunk> cels = frame.GetChunks<CelChunk>();\n\n                for (int i = 0; i < cels.Count; i++)\n                {\n                    if (cels[i].LayerIndex != layerIndex)\n                        continue;\n\n                    LayerBlendMode blendMode = layer.BlendMode;\n                    float opacity = Mathf.Min(layer.Opacity / 255f, cels[i].Opacity / 255f);\n\n                    bool visibility = layer.Visible;\n\n                    LayerChunk parent = GetParentLayer(layer);\n                    while (parent != null)\n                    {\n                        visibility &= parent.Visible;\n                        if (visibility == false)\n                            break;\n\n                        parent = GetParentLayer(parent);\n                    }\n\n                    if (visibility == false || layer.LayerType == LayerType.Group)\n                        continue;\n\n                    textures.Add(GetTextureFromCel(cels[i]));\n                }\n            }\n\n            return textures;\n        }\n\n        public Texture2D GetFrame(int index)\n        {\n            Frame frame = Frames[index];\n\n            Texture2D texture = Texture2DUtil.CreateTransparentTexture(Header.Width, Header.Height);\n\n            \n            List<LayerChunk> layers = GetChunks<LayerChunk>();\n            List<CelChunk> cels = frame.GetChunks<CelChunk>();\n\n            cels.Sort((ca, cb) => ca.LayerIndex.CompareTo(cb.LayerIndex));\n\n            for (int i = 0; i < cels.Count; i++)\n            {\n                LayerChunk layer = layers[cels[i].LayerIndex];\n                if (layer.LayerName.StartsWith(\"@\")) //ignore metadata layer\n                    continue;\n\n                LayerBlendMode blendMode = layer.BlendMode;\n                float opacity = Mathf.Min(layer.Opacity / 255f, cels[i].Opacity / 255f);\n\n                bool visibility = layer.Visible;\n\n\n                LayerChunk parent = GetParentLayer(layer);\n                while (parent != null)\n                {\n                    visibility &= parent.Visible;\n                    if (visibility == false)\n                        break;\n\n                    parent = GetParentLayer(parent);\n                }\n\n                if (visibility == false || layer.LayerType == LayerType.Group)\n                    continue;\n\n                Texture2D celTex = GetTextureFromCel(cels[i]);\n                \n                switch (blendMode)\n                {\n                    case LayerBlendMode.Normal: texture = Texture2DBlender.Normal(texture, celTex, opacity); break;\n                    case LayerBlendMode.Multiply: texture = Texture2DBlender.Multiply(texture, celTex, opacity); break;\n                    case LayerBlendMode.Screen: texture = Texture2DBlender.Screen(texture, celTex); break;\n                    case LayerBlendMode.Overlay: texture = Texture2DBlender.Overlay(texture, celTex); break;\n                    case LayerBlendMode.Darken: texture = Texture2DBlender.Darken(texture, celTex); break;\n                    case LayerBlendMode.Lighten: texture = Texture2DBlender.Lighten(texture, celTex); break;\n                    case LayerBlendMode.ColorDodge: texture = Texture2DBlender.ColorDodge(texture, celTex); break;\n                    case LayerBlendMode.ColorBurn: texture = Texture2DBlender.ColorBurn(texture, celTex); break;\n                    case LayerBlendMode.HardLight: texture = Texture2DBlender.HardLight(texture, celTex); break;\n                    case LayerBlendMode.SoftLight: texture = Texture2DBlender.SoftLight(texture, celTex); break;\n                    case LayerBlendMode.Difference: texture = Texture2DBlender.Difference(texture, celTex); break;\n                    case LayerBlendMode.Exclusion: texture = Texture2DBlender.Exclusion(texture, celTex); break;\n                    case LayerBlendMode.Hue: texture = Texture2DBlender.Hue(texture, celTex); break;\n                    case LayerBlendMode.Saturation: texture = Texture2DBlender.Saturation(texture, celTex); break;\n                    case LayerBlendMode.Color: texture = Texture2DBlender.Color(texture, celTex); break;\n                    case LayerBlendMode.Luminosity: texture = Texture2DBlender.Luminosity(texture, celTex); break;\n                    case LayerBlendMode.Addition: texture = Texture2DBlender.Addition(texture, celTex); break;\n                    case LayerBlendMode.Subtract: texture = Texture2DBlender.Subtract(texture, celTex); break;\n                    case LayerBlendMode.Divide: texture = Texture2DBlender.Divide(texture, celTex); break;\n                }\n            }\n\n            \n\n            return texture;\n        }\n\n        public Texture2D GetTextureFromCel(CelChunk cel)\n        {\n            int canvasWidth = Header.Width;\n            int canvasHeight = Header.Height;\n            \n            Texture2D texture = Texture2DUtil.CreateTransparentTexture(canvasWidth, canvasHeight);\n            Color[] colors = new Color[canvasWidth * canvasHeight];\n\n            int pixelIndex = 0;\n            int celXEnd = cel.Width + cel.X;\n            int celYEnd = cel.Height + cel.Y;\n\n\n            for (int y = cel.Y; y < celYEnd; y++)\n            {\n                if (y < 0 || y >= canvasHeight)\n                {\n                    pixelIndex += cel.Width;\n                    continue;\n                }\n\n                for (int x = cel.X; x < celXEnd; x++)\n                {\n                    if (x >= 0 && x < canvasWidth)\n                    {\n                        int index = (canvasHeight - 1 - y) * canvasWidth + x;\n                        colors[index] = cel.RawPixelData[pixelIndex].GetColor();\n                    }\n\n                    ++pixelIndex;\n                }\n            }\n\n            texture.SetPixels(0, 0, canvasWidth, canvasHeight, colors);\n            texture.Apply();\n\n            return texture;\n        }\n\n        public FrameTag[] GetAnimations()\n        {\n            List<FrameTagsChunk> tagChunks = this.GetChunks<FrameTagsChunk>();\n\n            List<FrameTag> animations = new List<FrameTag>();\n\n            foreach (FrameTagsChunk tagChunk in tagChunks)\n            {\n                foreach (FrameTag tag in tagChunk.Tags)\n                {\n                    animations.Add(tag);\n                }\n            }\n\n            return animations.ToArray();\n        }\n\n        public MetaData[] GetMetaData(Vector2 spritePivot, int pixelsPerUnit)\n        {\n            Dictionary<int, MetaData> metadatas = new Dictionary<int, MetaData>();\n\n            for (int index = 0; index < Frames.Count; index++)\n            {\n                List<LayerChunk> layers = GetChunks<LayerChunk>();\n                List<CelChunk> cels = Frames[index].GetChunks<CelChunk>();\n\n                cels.Sort((ca, cb) => ca.LayerIndex.CompareTo(cb.LayerIndex));\n\n                for (int i = 0; i < cels.Count; i++)\n                {\n                    int layerIndex = cels[i].LayerIndex;\n                    LayerChunk layer = layers[layerIndex];\n                    if (!layer.LayerName.StartsWith(MetaData.MetaDataChar)) //read only metadata layer\n                        continue;\n\n                    if (!metadatas.ContainsKey(layerIndex))\n                        metadatas[layerIndex] = new MetaData(layer.LayerName);\n                    var metadata = metadatas[layerIndex];\n\n                    CelChunk cel = cels[i];\n                    Vector2 center = Vector2.zero;\n                    int pixelCount = 0;\n\n                    for (int y = 0; y < cel.Height; ++y)\n                    {\n                        for (int x = 0; x < cel.Width; ++x)\n                        {\n                            int texX = cel.X + x;\n                            int texY = -(cel.Y + y) + Header.Height - 1;\n                            var col = cel.RawPixelData[x + y * cel.Width];\n                            if (col.GetColor().a > 0.1f)\n                            {\n                                center += new Vector2(texX, texY);\n                                pixelCount++;\n                            }\n                        }\n                    }\n\n                    if (pixelCount > 0)\n                    {\n                        center /= pixelCount;\n                        var pivot = Vector2.Scale(spritePivot, new Vector2(Header.Width, Header.Height));\n                        var posWorld = (center - pivot) / pixelsPerUnit + Vector2.one * 0.5f / pixelsPerUnit; //center pos in middle of pixels\n\n                        metadata.Transforms.Add(index, posWorld);\n                    }\n                }\n            }\n            return metadatas.Values.ToArray();\n        }\n\n        public Texture2D GetTextureAtlas()\n        {\n            Texture2D[] frames = this.GetFrames();\n\n            Texture2D atlas = Texture2DUtil.CreateTransparentTexture(Header.Width * frames.Length, Header.Height);\n            List<Rect> spriteRects = new List<Rect>();\n\n            int col = 0;\n            int row = 0;\n\n            foreach (Texture2D frame in frames)\n            {\n                Rect spriteRect = new Rect(col * Header.Width, atlas.height - ((row + 1) * Header.Height), Header.Width, Header.Height);\n                atlas.SetPixels((int)spriteRect.x, (int)spriteRect.y, (int)spriteRect.width, (int)spriteRect.height, frame.GetPixels());\n                atlas.Apply();\n\n                spriteRects.Add(spriteRect);\n\n                col++;\n            }\n\n            return atlas;\n        }\n    }\n\n}\n"
  },
  {
    "path": "Editor/Aseprite/AseFile.cs.meta",
    "content": "fileFormatVersion: 2\nguid: 5f6a61a631c3f814e93b303b62bd11fb\nMonoImporter:\n  externalObjects: {}\n  serializedVersion: 2\n  defaultReferences: []\n  executionOrder: 0\n  icon: {instanceID: 0}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "Editor/Aseprite/Chunk.cs",
    "content": "﻿using Aseprite.Chunks;\nusing System.IO;\n\nnamespace Aseprite\n{\n    public enum ChunkType : ushort\n    {\n        OldPalette = 0x0004,\n        OldPalette2 = 0x0011,\n        Layer = 0x2004,\n        Cel = 0x2005,\n        CelExtra = 0x2006,\n        Mask = 0x2016, // DEPRECATED\n        Path = 0x2017 , // NEVER USED\n        FrameTags = 0x2018,\n        Palette = 0x2019,\n        UserData = 0x2020\n    }\n\n    public class Chunk\n    {\n        public const int HEADER_SIZE = 6;\n\n        protected Frame Frame = null;\n        public uint Length { get; private set; }\n        public ChunkType ChunkType { get; private set; }\n\n        public Chunk(uint length, ChunkType type)\n        {\n            Length = length;\n            ChunkType = type;\n        }\n\n        public static Chunk ReadChunk(Frame frame, BinaryReader reader)\n        {\n            uint length = reader.ReadUInt32();\n            ChunkType type = (ChunkType)reader.ReadUInt16();\n\n            switch (type)\n            {\n                case ChunkType.Cel:\n                    return CelChunk.ReadCelChunk(length, reader, frame);\n                case ChunkType.CelExtra:\n                    return new CelExtraChunk(length, reader) { Frame = frame };\n                case ChunkType.Layer:\n                    return new LayerChunk(length, reader) { Frame = frame };\n                case ChunkType.FrameTags:\n                    return new FrameTagsChunk(length, reader) { Frame = frame };\n                case ChunkType.Palette:\n                    return new PaletteChunk(length, reader) { Frame = frame };\n            }\n\n            reader.BaseStream.Position += length - Chunk.HEADER_SIZE;\n            return null;\n        }\n    }\n}\n"
  },
  {
    "path": "Editor/Aseprite/Chunk.cs.meta",
    "content": "fileFormatVersion: 2\nguid: dbc05236857fc94458c289aacc017ab1\nMonoImporter:\n  externalObjects: {}\n  serializedVersion: 2\n  defaultReferences: []\n  executionOrder: 0\n  icon: {instanceID: 0}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "Editor/Aseprite/Chunks/CelChunk.cs",
    "content": "﻿using Aseprite.PixelFormats;\nusing System.IO;\n\n\nnamespace Aseprite.Chunks\n{\n    public enum CelType : ushort\n    {\n        Raw = 0,\n        Linked = 1,\n        Compressed = 2\n    }\n\n    public class CelChunk : Chunk\n    {\n        public ushort LayerIndex { get; private set; }\n        public short X { get; private set; }\n        public short Y { get; private set; }\n        public virtual ushort Width { get; protected set; }\n        public virtual ushort Height { get; protected set; }\n        public byte Opacity { get; set; }\n        public CelType CelType { get; set; }\n\n        public virtual Pixel[] RawPixelData { get; protected set; }\n\n\n        public CelChunk(uint length, ushort layerIndex, short x, short y, byte opacity, CelType type) : base(length, ChunkType.Cel)\n        {\n            LayerIndex = layerIndex;\n            X = x;\n            Y = y;\n            Opacity = opacity;\n            CelType = type;\n        }\n\n        protected void ReadPixelData(BinaryReader reader, Frame frame)\n        {\n            int size = Width * Height;\n            RawPixelData = new Pixel[size];\n\n            switch (frame.File.Header.ColorDepth)\n            {\n                case ColorDepth.RGBA:\n                    for (int i = 0; i < size; i++)\n                    {\n                        byte[] color = reader.ReadBytes(4);\n\n                        RawPixelData[i] = new RGBAPixel(frame, color);\n                    }\n                    break;\n                case ColorDepth.Grayscale:\n                    for (int i = 0; i < size; i++)\n                    {\n                        byte[] color = reader.ReadBytes(2);\n\n                        RawPixelData[i] = new GrayscalePixel(frame, color);\n                    }\n                    break;\n                case ColorDepth.Indexed:\n                    for (int i = 0; i < size; i++)\n                    {\n                        byte color = reader.ReadByte();\n\n                        RawPixelData[i] = new IndexedPixel(frame, color);\n                    }\n                    break;\n            }\n        }\n\n\n\n        public static CelChunk ReadCelChunk(uint length, BinaryReader reader, Frame frame)\n        {\n            ushort layerIndex = reader.ReadUInt16();\n            short x = reader.ReadInt16();\n            short y = reader.ReadInt16();\n            byte opacity = reader.ReadByte();\n            CelType type = (CelType)reader.ReadUInt16();\n\n            reader.ReadBytes(7); // For Future\n\n\n            switch (type)\n            {\n                case CelType.Raw:\n                    return new RawCelChunk(length, layerIndex, x, y, opacity, frame, reader);\n                case CelType.Linked:\n                    return new LinkedCelChunk(length, layerIndex, x, y, opacity, frame, reader);\n                case CelType.Compressed:\n                    return new CompressedCelChunk(length, layerIndex, x, y, opacity, frame, reader);\n            }\n\n\n            return null;\n        }\n\n    }\n}\n"
  },
  {
    "path": "Editor/Aseprite/Chunks/CelChunk.cs.meta",
    "content": "fileFormatVersion: 2\nguid: 5e1467a329f50d445a90966702aa143d\nMonoImporter:\n  externalObjects: {}\n  serializedVersion: 2\n  defaultReferences: []\n  executionOrder: 0\n  icon: {instanceID: 0}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "Editor/Aseprite/Chunks/CelExtraChunk.cs",
    "content": "﻿using System.IO;\n\nnamespace Aseprite.Chunks\n{\n    public class CelExtraChunk : Chunk\n    {\n        public uint Flags { get; private set; }\n        public float PreciseX { get; private set; }\n        public float PreciseY { get; private set; }\n        public float Width { get; private set; }\n        public float Height { get; private set; }\n\n        public CelExtraChunk(uint length, BinaryReader reader) : base(length, ChunkType.CelExtra)\n        {\n            Flags = reader.ReadUInt32();\n            PreciseX = reader.ReadSingle();\n            PreciseY = reader.ReadSingle();\n            Width = reader.ReadSingle();\n            Height = reader.ReadSingle();\n\n            reader.ReadBytes(16); // For Future\n        }\n    }\n}\n"
  },
  {
    "path": "Editor/Aseprite/Chunks/CelExtraChunk.cs.meta",
    "content": "fileFormatVersion: 2\nguid: 90f3d37a4a05aa44881a5388f24659f1\nMonoImporter:\n  externalObjects: {}\n  serializedVersion: 2\n  defaultReferences: []\n  executionOrder: 0\n  icon: {instanceID: 0}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "Editor/Aseprite/Chunks/CompressedCelChunk.cs",
    "content": "﻿using System.IO;\nusing System.IO.Compression;\n\nnamespace Aseprite.Chunks\n{\n    public class CompressedCelChunk : CelChunk\n    {\n\n        public byte[] CompressedRawCell { get; private set; }\n\n        public CompressedCelChunk(uint length, ushort layerIndex, short x, short y, byte opacity, Frame frame, BinaryReader reader) : base(length, layerIndex, x, y, opacity, CelType.Compressed)\n        {\n\n            Width = reader.ReadUInt16();\n            Height = reader.ReadUInt16();\n\n            reader.ReadBytes(2);\n            int compressedDataSize = (int)(length - 22) - Chunk.HEADER_SIZE;\n\n            CompressedRawCell = reader.ReadBytes(compressedDataSize);\n\n            byte[] buffer = new byte[1024];\n\n            MemoryStream uncompressed = new MemoryStream();\n\n            using (MemoryStream s = new MemoryStream(CompressedRawCell))\n            {\n                using (DeflateStream gzip = new DeflateStream(s, CompressionMode.Decompress))\n                {\n\n                    int len = 0;\n                    do\n                    {\n                        len = gzip.Read(buffer, 0, buffer.Length);\n\n                        if (len > 0)\n                        {\n                            uncompressed.Write(buffer, 0, len);\n                        }\n\n                    } while (len > 0);\n\n                }\n            }\n\n\n            uncompressed.Position = 0;\n            BinaryReader ureader = new BinaryReader(uncompressed);\n\n            ReadPixelData(ureader, frame);\n        }\n    }\n}\n"
  },
  {
    "path": "Editor/Aseprite/Chunks/CompressedCelChunk.cs.meta",
    "content": "fileFormatVersion: 2\nguid: 0b76e46ec4426b845a3e91a2eaa3e2db\nMonoImporter:\n  externalObjects: {}\n  serializedVersion: 2\n  defaultReferences: []\n  executionOrder: 0\n  icon: {instanceID: 0}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "Editor/Aseprite/Chunks/FrameTagsChunk.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.IO;\nusing System.Text;\nusing UnityEngine;\n\nnamespace Aseprite.Chunks\n{\n    public enum LoopAnimation : byte\n    {\n        Forward = 0,\n        Reverse = 1,\n        PingPong = 2,\n    }\n\n\n    public class FrameTag\n    {\n        public ushort FrameFrom { get; private set; }\n        public ushort FrameTo { get; private set; }\n        public LoopAnimation Animation { get; private set; }\n        private byte[] ForFuture { get; set; } // 8 Bytes\n        public Color TagColor { get; set; } // 3 Bytes\n        // 1 Extra Byte\n        public string TagName { get; private set; }\n\n        public FrameTag(BinaryReader reader)\n        {\n            FrameFrom = reader.ReadUInt16();\n            FrameTo = reader.ReadUInt16();\n            Animation = (LoopAnimation)reader.ReadByte();\n            ForFuture = reader.ReadBytes(8);\n\n            byte[] colorBytes = reader.ReadBytes(3);\n            TagColor = new Color((colorBytes[0] / 255f), (colorBytes[1] / 255f), (colorBytes[2] / 255f));\n\n            reader.ReadByte(); // Extra byte (zero)\n\n            ushort nameLength = reader.ReadUInt16();\n            TagName = Encoding.Default.GetString(reader.ReadBytes(nameLength));\n        }\n    }\n\n    public class FrameTagsChunk : Chunk\n    {\n        public ushort TagCount { get; private set; }\n        private byte[] ForFuture { get; set; } // 8 Bytes\n        \n        public List<FrameTag> Tags { get; private set; }\n\n        public FrameTagsChunk(uint length, BinaryReader reader) : base(length, ChunkType.FrameTags)\n        {\n            TagCount = reader.ReadUInt16();\n            ForFuture = reader.ReadBytes(8);\n\n            Tags = new List<FrameTag>();\n\n            for (int i = 0; i < TagCount; i++)\n            {\n                Tags.Add(new FrameTag(reader));\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Editor/Aseprite/Chunks/FrameTagsChunk.cs.meta",
    "content": "fileFormatVersion: 2\nguid: 0cde5e837af814d4eaa39712072c6626\nMonoImporter:\n  externalObjects: {}\n  serializedVersion: 2\n  defaultReferences: []\n  executionOrder: 0\n  icon: {instanceID: 0}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "Editor/Aseprite/Chunks/LayerChunk.cs",
    "content": "﻿using System.IO;\nusing System.Text;\n\nnamespace Aseprite.Chunks\n{\n    public enum LayerType : ushort\n    {\n        Normal = 0,\n        Group = 1\n    }\n\n    public enum LayerBlendMode : ushort\n    {\n        Normal = 0,\n        Multiply = 1,\n        Screen = 2,\n        Overlay = 3,\n        Darken = 4,\n        Lighten = 5,\n        ColorDodge = 6,\n        ColorBurn = 7,\n        HardLight = 8,\n        SoftLight = 9,\n        Difference = 10,\n        Exclusion = 11,\n        Hue = 12,\n        Saturation = 13,\n        Color = 14,\n        Luminosity = 15,\n        Addition = 16,\n        Subtract = 17,\n        Divide = 18\n    }\n\n    public class LayerChunk : Chunk\n    {\n        public ushort Flags { get; private set; }\n        public LayerType LayerType { get; private set; }\n        public ushort LayerChildLevel { get; private set; }\n        public ushort DefaultLayerWidth { get; private set; } // Ignored\n        public ushort DefaultLayerHeight { get; private set; } // Ignored\n        public LayerBlendMode BlendMode { get; private set; }\n        public byte Opacity { get; private set; }\n\n        public string LayerName { get; private set; }\n\n        public bool Visible\n        {\n            get { return Flags % 2 == 1; }\n        }\n\n        public LayerChunk(uint length, BinaryReader reader) : base(length, ChunkType.Layer)\n        {\n            Flags = reader.ReadUInt16();\n            LayerType = (LayerType)reader.ReadUInt16();\n            LayerChildLevel = reader.ReadUInt16();\n\n            DefaultLayerWidth = reader.ReadUInt16(); // Ignored\n            DefaultLayerHeight = reader.ReadUInt16(); // Ignored\n\n            BlendMode = (LayerBlendMode)reader.ReadUInt16();\n            Opacity = reader.ReadByte();\n\n            reader.ReadBytes(3); // For future\n\n            ushort nameLength = reader.ReadUInt16();\n            ///int nameLength = (int)(length - 18) - Chunk.HEADER_SIZE;\n            LayerName = Encoding.Default.GetString(reader.ReadBytes(nameLength));\n        }\n    }\n}\n"
  },
  {
    "path": "Editor/Aseprite/Chunks/LayerChunk.cs.meta",
    "content": "fileFormatVersion: 2\nguid: 6c4b9dd3b6509db46aa8d021701c8287\nMonoImporter:\n  externalObjects: {}\n  serializedVersion: 2\n  defaultReferences: []\n  executionOrder: 0\n  icon: {instanceID: 0}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "Editor/Aseprite/Chunks/LinkedCelChunk.cs",
    "content": "﻿using System.IO;\n\nnamespace Aseprite.Chunks\n{\n    public class LinkedCelChunk : CelChunk\n    {\n        private AseFile file = null;\n        private CelChunk linkedCelChunk = null;\n\n\n        public CelChunk LinkedCel\n        {\n            get\n            {\n                if (linkedCelChunk == null)\n                {\n                    linkedCelChunk = file.Frames[FramePosition].GetCelChunk<CelChunk>(LayerIndex);\n                }\n\n                return linkedCelChunk;\n            }\n        }\n\n        public ushort FramePosition { get; private set; }\n\n\n\n        public override ushort Width { get { return LinkedCel.Width; } }\n        public override ushort Height { get { return LinkedCel.Height; } }\n        public override Pixel[] RawPixelData { get { return LinkedCel.RawPixelData; } }\n\n\n        public LinkedCelChunk(uint length, ushort layerIndex, short x, short y, byte opacity, Frame frame, BinaryReader reader) : base(length, layerIndex, x, y, opacity, CelType.Linked)\n        {\n            file = frame.File;\n\n            FramePosition = reader.ReadUInt16();\n        }\n    }\n}\n"
  },
  {
    "path": "Editor/Aseprite/Chunks/LinkedCelChunk.cs.meta",
    "content": "fileFormatVersion: 2\nguid: e72472c94f4cdee4e9e1fc5370d46c31\nMonoImporter:\n  externalObjects: {}\n  serializedVersion: 2\n  defaultReferences: []\n  executionOrder: 0\n  icon: {instanceID: 0}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "Editor/Aseprite/Chunks/PaletteChunk.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.IO;\nusing UnityEngine;\n\nnamespace Aseprite.Chunks\n{\n    public class PaletteEntry\n    {\n        public ushort EntryFlags { get; private set; }\n\n        public byte Red { get; private set; }\n        public byte Green { get; private set; }\n        public byte Blue { get; private set; }\n        public byte Alpha { get; private set; }\n\n        public string Name { get; private set; }\n\n        public PaletteEntry(BinaryReader reader)\n        {\n            EntryFlags = reader.ReadUInt16();\n\n            Red = reader.ReadByte();\n            Green = reader.ReadByte();\n            Blue = reader.ReadByte();\n            Alpha = reader.ReadByte();\n\n            if ((EntryFlags & 1) != 0)\n            {\n                Name = reader.ReadString();\n            }\n        }\n    }\n\n\n    public class PaletteChunk : Chunk\n    {\n        public uint PaletteSize { get; private set; }\n        public uint FirstColorIndex { get; private set; }\n        public uint LastColorIndex { get; private set; }\n\n        // Future (8) bytes\n\n        public List<PaletteEntry> Entries { get; private set; }\n\n\n        public PaletteChunk(uint length, BinaryReader reader) : base(length, ChunkType.Palette)\n        {\n            PaletteSize = reader.ReadUInt32();\n            FirstColorIndex = reader.ReadUInt32();\n            LastColorIndex = reader.ReadUInt32();\n\n            reader.ReadBytes(8); // For Future\n\n            Entries = new List<PaletteEntry>();\n\n            for (int i = 0; i < PaletteSize; i++)\n            {\n                Entries.Add(new PaletteEntry(reader));\n            }\n        }\n\n\n        public Color GetColor(byte index)\n        {\n            if (index >= FirstColorIndex && index <= LastColorIndex)\n            {\n                PaletteEntry entry = Entries[index];\n\n                float red = (float)entry.Red / 255f;\n                float green = (float)entry.Green / 255f;\n                float blue = (float)entry.Blue / 255f;\n                float alpha = (float)entry.Alpha / 255f;\n\n                return new Color(red, green, blue, alpha);\n            }\n            else\n            {\n                return Color.magenta;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Editor/Aseprite/Chunks/PaletteChunk.cs.meta",
    "content": "fileFormatVersion: 2\nguid: 9cea5334fc11c024fb6cc4f2b2f65138\nMonoImporter:\n  externalObjects: {}\n  serializedVersion: 2\n  defaultReferences: []\n  executionOrder: 0\n  icon: {instanceID: 0}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "Editor/Aseprite/Chunks/RawCelChunk.cs",
    "content": "﻿using System.IO;\n\nnamespace Aseprite.Chunks\n{\n    public class RawCelChunk : CelChunk\n    {\n\n        public RawCelChunk(uint length, ushort layerIndex, short x, short y, byte opacity, Frame frame, BinaryReader reader) : base(length, layerIndex, x, y, opacity, CelType.Raw)\n        {\n            Width = reader.ReadUInt16();\n            Height = reader.ReadUInt16();\n\n            ReadPixelData(reader, frame);\n        }\n    }\n}\n"
  },
  {
    "path": "Editor/Aseprite/Chunks/RawCelChunk.cs.meta",
    "content": "fileFormatVersion: 2\nguid: a630311c9aee5574783e5d2bc5495427\nMonoImporter:\n  externalObjects: {}\n  serializedVersion: 2\n  defaultReferences: []\n  executionOrder: 0\n  icon: {instanceID: 0}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "Editor/Aseprite/Chunks.meta",
    "content": "fileFormatVersion: 2\nguid: f17568d0d620ffa4586ca7aa1bda9b03\nfolderAsset: yes\nDefaultImporter:\n  externalObjects: {}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "Editor/Aseprite/Frame.cs",
    "content": "﻿using Aseprite.Chunks;\nusing System.Collections.Generic;\nusing System.IO;\nusing UnityEngine;\n\nnamespace Aseprite\n{\n    public class Frame\n    {\n        public AseFile File = null;\n\n        public uint Length { get; private set; }\n        public ushort MagicNumber { get; private set; }\n        \n        public ushort OldChunksCount { get; private set; }\n        public uint ChunksCount { get; private set; }\n        public ushort FrameDuration { get; private set; }\n\n        public List<Chunk> Chunks { get; private set; }\n        \n        private bool useNewChunkCount = true;\n        \n        public uint GetChunkCount()\n        {\n            if (useNewChunkCount)\n                return ChunksCount;\n            else\n                return OldChunksCount;\n        }\n\n        public Frame(AseFile file, BinaryReader reader)\n        {\n            File = file;\n\n            Length = reader.ReadUInt32();\n            MagicNumber = reader.ReadUInt16();\n\n            OldChunksCount = reader.ReadUInt16();\n            FrameDuration = reader.ReadUInt16();\n\n            reader.ReadBytes(2); // For Future\n            \n            ChunksCount = reader.ReadUInt32();\n            if (ChunksCount == 0)\n                useNewChunkCount = false;\n\n            Chunks = new List<Chunk>();\n\n            for (int i = 0; i < GetChunkCount(); i++)\n            {\n                Chunk chunk = Chunk.ReadChunk(this, reader);\n\n                if (chunk != null)\n                    Chunks.Add(chunk);\n            }\n        }\n\n        public T GetChunk<T>() where T : Chunk\n        {\n            for (int i = 0; i < Chunks.Count; i++)\n            {\n                if (Chunks[i] is T)\n                {\n                    return (T)Chunks[i];\n                }\n            }\n\n            return null;\n        }\n\n        public T GetCelChunk<T>(int layerIndex) where T : CelChunk\n        {\n            for (int i = 0; i < Chunks.Count; i++)\n            {\n                if (Chunks[i] is T && (Chunks[i] as CelChunk).LayerIndex == layerIndex)\n                {\n                    return (T)Chunks[i];\n                }\n            }\n\n            return null;\n        }\n\n        public List<T> GetChunks<T>() where T : Chunk\n        {\n            List<T> chunks = new List<T>();\n\n            for (int i = 0; i < Chunks.Count; i++)\n            {\n                if (Chunks[i] is T)\n                {\n                    chunks.Add((T)Chunks[i]);\n                }\n            }\n\n            return chunks;\n        }\n    }\n}\n"
  },
  {
    "path": "Editor/Aseprite/Frame.cs.meta",
    "content": "fileFormatVersion: 2\nguid: 8fafeae19a0bb304f8ee925080f59427\nMonoImporter:\n  externalObjects: {}\n  serializedVersion: 2\n  defaultReferences: []\n  executionOrder: 0\n  icon: {instanceID: 0}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "Editor/Aseprite/Header.cs",
    "content": "﻿using System.IO;\n\n\nnamespace Aseprite\n{\n    public enum ColorDepth : ushort\n    {\n        RGBA = 32,\n        Grayscale = 16,\n        Indexed = 8\n    }\n\n    public class Header\n    {\n\n        public uint FileSize { get; private set; }\n        public ushort MagicNumber { get; private set; }\n        public ushort Frames { get; private set; }\n        public ushort Width { get; private set; }\n        public ushort Height { get; private set; }\n        public ColorDepth ColorDepth { get; private set; }\n        public uint Flags { get; private set; }\n        public ushort Speed { get; private set; }\n\n        public byte TransparentIndex { get; private set; }\n\n        public ushort ColorCount { get; private set; }\n        public byte PixelWidth { get; private set; }\n        public byte PixelHeight { get; private set; }\n\n        public Header(byte[] header)\n        {\n            if (header.Length != 128)\n                return;\n\n            Stream stream = new MemoryStream(header);\n            BinaryReader reader = new BinaryReader(stream);\n\n            FileSize = reader.ReadUInt32();         // File size\n            MagicNumber = reader.ReadUInt16();      // Magic number (0xA5E0)\n            Frames = reader.ReadUInt16();           // Frames\n            Width = reader.ReadUInt16();            // Width in pixels\n            Height = reader.ReadUInt16();           // Height in pixels\n            ColorDepth = (ColorDepth)reader.ReadUInt16();       // Color depth (bits per pixel) [32 bpp = RGBA, 16 bpp = Grayscale, 8 bpp Indexed]\n            Flags = reader.ReadUInt32();            // Flags: 1 = Layer opacity has valid value\n            Speed = reader.ReadUInt16();            // Speed (milliseconds between frame, like in FLC files) DEPRECATED: You should use the frame duration field from each frame header\n\n            reader.ReadUInt32();                    // Set be 0\n            reader.ReadUInt32();                    // Set be 0\n\n            TransparentIndex = reader.ReadByte();   // Palette entry (index) which represent transparent color in all non-background layers (only for Indexed sprites)\n\n            reader.ReadBytes(3);                    // Ignore these bytes\n\n            ColorCount = reader.ReadUInt16();       // Number of colors (0 means 256 for old sprites)\n            PixelWidth = reader.ReadByte();         // Pixel width (pixel ratio is \"pixel width/pixel height\"). If pixel height field is zero, pixel ratio is 1:1\n            PixelHeight = reader.ReadByte();        // Pixel height\n\n            reader.ReadBytes(92);                   // For future\n        }\n\n    }\n}\n"
  },
  {
    "path": "Editor/Aseprite/Header.cs.meta",
    "content": "fileFormatVersion: 2\nguid: 63307b484f7407a47b3ed163139b29a8\nMonoImporter:\n  externalObjects: {}\n  serializedVersion: 2\n  defaultReferences: []\n  executionOrder: 0\n  icon: {instanceID: 0}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "Editor/Aseprite/MetaData.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Text.RegularExpressions;\nusing UnityEngine;\n\nnamespace Aseprite\n{\n    public enum MetaDataType { UNKNOWN, TRANSFORM };\n\n    public class MetaData\n    {\n        static public string MetaDataChar = \"@\";\n\n        public MetaDataType Type { get; private set; }\n        //Average position per frames\n        public Dictionary<int, Vector2> Transforms { get; private set; }\n        public List<string> Args { get; private set; }\n\n        public MetaData(string layerName)\n        {\n            var regex = new Regex(\"@transform\\\\(\\\"(.*)\\\"\\\\)\");\n            var match = regex.Match(layerName);\n            if (match.Success)\n            {\n                Type = MetaDataType.TRANSFORM;\n                Args = new List<string>();\n                Args.Add(match.Groups[1].Value);\n                Transforms = new Dictionary<int, Vector2>();\n            }\n            else\n                Debug.LogWarning($\"Unsupported aseprite metadata {layerName}\");\n        }\n    }\n}\n"
  },
  {
    "path": "Editor/Aseprite/MetaData.cs.meta",
    "content": "fileFormatVersion: 2\nguid: caeeb318f19505542b1d534e7a47f20d\nMonoImporter:\n  externalObjects: {}\n  serializedVersion: 2\n  defaultReferences: []\n  executionOrder: 0\n  icon: {instanceID: 0}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "Editor/Aseprite/Pixel.cs",
    "content": "﻿using UnityEngine;\n\nnamespace Aseprite\n{\n    public abstract class Pixel\n    {\n        protected Frame Frame = null;\n        public abstract Color GetColor();\n\n        public Pixel(Frame frame)\n        {\n            Frame = frame;\n        }\n    }\n}\n\n"
  },
  {
    "path": "Editor/Aseprite/Pixel.cs.meta",
    "content": "fileFormatVersion: 2\nguid: fd1cf168dbce67a4a9abe9b9f5caa754\nMonoImporter:\n  externalObjects: {}\n  serializedVersion: 2\n  defaultReferences: []\n  executionOrder: 0\n  icon: {instanceID: 0}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "Editor/Aseprite/PixelFormats/GrayscalePixel.cs",
    "content": "﻿using UnityEngine;\n\nnamespace Aseprite.PixelFormats\n{\n    public class GrayscalePixel : Pixel\n    {\n        public byte[] Color { get; private set; }\n\n        public GrayscalePixel(Frame frame, byte[] color) : base(frame)\n        {\n            Color = color;\n        }\n\n        public override Color GetColor()\n        {\n            float value = (float)Color[0] / 255;\n            float alpha = (float)Color[1] / 255;\n\n            return new Color(value, value, value, alpha);\n        }\n    }\n}\n"
  },
  {
    "path": "Editor/Aseprite/PixelFormats/GrayscalePixel.cs.meta",
    "content": "fileFormatVersion: 2\nguid: fd4a1ad4688db084f99937a1d439d777\nMonoImporter:\n  externalObjects: {}\n  serializedVersion: 2\n  defaultReferences: []\n  executionOrder: 0\n  icon: {instanceID: 0}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "Editor/Aseprite/PixelFormats/IndexedPixel.cs",
    "content": "﻿using Aseprite.Chunks;\nusing UnityEngine;\n\nnamespace Aseprite.PixelFormats\n{\n    public class IndexedPixel : Pixel\n    {\n        public byte Index { get; private set; }\n\n        public IndexedPixel(Frame frame, byte index) : base(frame)\n        {\n            Index = index;\n        }\n\n        public override Color GetColor()\n        {\n            PaletteChunk palette = Frame.File.GetChunk<PaletteChunk>();\n\n            if (palette != null)\n                return palette.GetColor(Index);\n            else\n                return Color.magenta;\n        }\n    }\n}\n"
  },
  {
    "path": "Editor/Aseprite/PixelFormats/IndexedPixel.cs.meta",
    "content": "fileFormatVersion: 2\nguid: f23bac97f4c881a41a78289b5a2d2d5b\nMonoImporter:\n  externalObjects: {}\n  serializedVersion: 2\n  defaultReferences: []\n  executionOrder: 0\n  icon: {instanceID: 0}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "Editor/Aseprite/PixelFormats/RGBAPixel.cs",
    "content": "﻿using UnityEngine;\n\nnamespace Aseprite.PixelFormats\n{\n    public class RGBAPixel : Pixel\n    {\n        public byte[] Color { get; private set; }\n\n        public RGBAPixel(Frame frame, byte[] color) : base(frame)\n        {\n            Color = color;\n        }\n\n        public override Color GetColor()\n        {\n            if (Color.Length == 4)\n            {\n                float red = (float)Color[0] / 255f;\n                float green = (float)Color[1] / 255f;\n                float blue = (float)Color[2] / 255f;\n                float alpha = (float)Color[3] / 255f;\n\n                return new Color(red, green, blue, alpha);\n            }\n            else\n            {\n                return UnityEngine.Color.magenta;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Editor/Aseprite/PixelFormats/RGBAPixel.cs.meta",
    "content": "fileFormatVersion: 2\nguid: 6a558251a7db6cd43b0df24010c22509\nMonoImporter:\n  externalObjects: {}\n  serializedVersion: 2\n  defaultReferences: []\n  executionOrder: 0\n  icon: {instanceID: 0}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "Editor/Aseprite/PixelFormats.meta",
    "content": "fileFormatVersion: 2\nguid: cf5da52f29e5eff4caae74c16760e93a\nfolderAsset: yes\nDefaultImporter:\n  externalObjects: {}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "Editor/Aseprite/Utils/Texture2DBlender.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing UnityEngine;\n\n// See: http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/devnet/pdf/pdfs/PDF32000_2008.pdf\n// Page 333\nnamespace Aseprite.Utils\n{\n    public static class Texture2DBlender\n    {        \n        public static float Multiply(float b, float s)\n        {\n            return b * s;\n        }\n\n        public static float Screen(float b, float s)\n        {\n            return b + s - (b * s);\n        }\n\n        public static float Overlay(float b, float s)\n        {\n            return HardLight(s, b);\n        }\n\n        public static float Darken(float b, float s)\n        {\n            return Mathf.Min(b, s);\n        }\n\n        public static float Lighten(float b, float s)\n        {\n            return Mathf.Max(b, s);\n        }\n\n        // Color Dodge & Color Burn:  http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/devnet/pdf/pdfs/adobe_supplement_iso32000_1.pdf\n        public static float ColorDodge(float b, float s)\n        {\n            if (b == 0)\n                return 0;\n            else if (b >= (1 - s))\n                return 1;\n            else\n                return b / (1 - s);\n        }\n\n        public static float ColorBurn(float b, float s)\n        {\n            if (b == 1)\n                return 1;\n            else if ((1 - b) >= s)\n                return 0;\n            else\n                return 1 - ((1 - b) / s);\n        }\n\n        public static float HardLight(float b, float s)\n        {\n            if (s <= 0.5)\n                return Multiply(b, 2 * s);\n            else\n                return Screen(b, 2 * s - 1);\n        }\n\n        public static float SoftLight(float b, float s)\n        {\n            if (s <= 0.5)\n                return b - (1 - 2 * s) * b * (1 - b);\n            else\n                return b + (2 * s - 1) * (SoftLightD(b) - b);\n        }\n\n        private static float SoftLightD(float x)\n        {\n            if (x <= 0.25)\n                return ((16 * x - 12) * x + 4) * x;\n            else\n                return Mathf.Sqrt(x);\n        }\n\n        public static float Difference(float b, float s)\n        {\n            return Mathf.Abs(b - s);\n        }\n\n        public static float Exclusion(float b, float s)\n        {\n            return b + s - 2 * b * s;\n        }\n\n\n        public static Texture2D Normal(Texture2D baseLayer, Texture2D layer, float opacity)\n        {\n            Texture2D newLayer = new Texture2D(baseLayer.width, baseLayer.height);\n\n            for (int x = 0; x < baseLayer.width; x++)\n            {\n                for (int y = 0; y < baseLayer.height; y++)\n                {\n                    Color a = baseLayer.GetPixel(x, y);\n                    Color b = layer.GetPixel(x, y);\n\n                    \n                    Color c = new Color();\n                    b.a = b.a * opacity;\n\n                    c = ((1f - b.a) * a) + (b.a * b);\n                    c.a = a.a + b.a * (1f - a.a);\n\n                    newLayer.SetPixel(x, y, c);\n                }\n            }\n\n            newLayer.Apply();\n\n            return newLayer;\n        }\n\n        public static Texture2D Multiply(Texture2D baseLayer, Texture2D layer, float opacity)\n        {\n            Texture2D newLayer = new Texture2D(baseLayer.width, baseLayer.height);\n\n            for (int x = 0; x < baseLayer.width; x++)\n            {\n                for (int y = 0; y < baseLayer.height; y++)\n                {\n                    Color a = baseLayer.GetPixel(x, y);\n                    Color b = layer.GetPixel(x, y);\n\n                    Color c = new Color();\n\n                    c.r = (a.r) * (opacity * (1f - b.a * (1f - b.r)));\n                    c.g = (a.g) * (opacity * (1f - b.a * (1f - b.g)));\n                    c.b = (a.b) * (opacity * (1f - b.a * (1f - b.b)));\n                    c.a = a.a + b.a * (1f - a.a);\n\n                    newLayer.SetPixel(x, y, c);\n                }\n            }\n\n            newLayer.Apply();\n\n            return newLayer;\n        }\n\n\n        public static Texture2D Screen(Texture2D baseLayer, Texture2D layer)\n        {\n            Texture2D newLayer = new Texture2D(baseLayer.width, baseLayer.height);\n\n            for (int x = 0; x < baseLayer.width; x++)\n            {\n                for (int y = 0; y < baseLayer.height; y++)\n                {\n                    Color a = baseLayer.GetPixel(x, y);\n                    Color b = layer.GetPixel(x, y);\n\n                    Color c = a + b - (a * b);\n\n                    newLayer.SetPixel(x, y, c);\n                }\n            }\n\n            newLayer.Apply();\n\n            return newLayer;\n        }\n\n        public static Texture2D Overlay(Texture2D baseLayer, Texture2D layer)\n        {\n            Texture2D newLayer = new Texture2D(baseLayer.width, baseLayer.height);\n\n            for (int x = 0; x < baseLayer.width; x++)\n            {\n                for (int y = 0; y < baseLayer.height; y++)\n                {\n                    Color a = baseLayer.GetPixel(x, y);\n                    Color b = layer.GetPixel(x, y);\n                    \n                    Color c = new Color();\n\n\n                    if (a.r < 0.5)\n                        c.r = 2f * a.r * b.r;\n                    else\n                        c.r = 1f - 2f * (1f - b.r) * (1f - a.r);\n\n                    if (a.g < 0.5)\n                        c.g = 2f * a.g * b.g;\n                    else\n                        c.g = 1f - 2f * (1f - b.g) * (1f - a.g);\n\n                    if (a.b < 0.5)\n                        c.b = 2f * a.b * b.b;\n                    else\n                        c.b = 1f - 2f * (1f - b.b) * (1f - a.b);\n\n                    c = ((1f - b.a) * a) + (b.a * c);\n\n                    c.a = a.a + b.a * (1f - a.a);\n\n                    \n\n                    newLayer.SetPixel(x, y, c);\n                    \n                }\n            }\n\n            newLayer.Apply();\n    \n            return newLayer;\n        }\n\n        public static Texture2D Darken(Texture2D baseLayer, Texture2D layer)\n        {\n            Texture2D newLayer = new Texture2D(baseLayer.width, baseLayer.height);\n\n            for (int x = 0; x < baseLayer.width; x++)\n            {\n                for (int y = 0; y < baseLayer.height; y++)\n                {\n                    Color a = baseLayer.GetPixel(x, y);\n                    Color b = layer.GetPixel(x, y);\n\n                    Color c = new Color();\n\n\n                    c.r = Mathf.Min(a.r, b.r);\n                    c.g = Mathf.Min(a.g, b.g);\n                    c.b = Mathf.Min(a.b, b.b);\n\n                    c = ((1f - b.a) * a) + (b.a * c);\n                    c.a = a.a + b.a * (1f - a.a);\n\n                    newLayer.SetPixel(x, y, c);\n                }\n            }\n\n            newLayer.Apply();\n\n            return newLayer;\n        }\n\n        public static Texture2D Lighten(Texture2D baseLayer, Texture2D layer)\n        {\n            Texture2D newLayer = new Texture2D(baseLayer.width, baseLayer.height);\n\n            for (int x = 0; x < baseLayer.width; x++)\n            {\n                for (int y = 0; y < baseLayer.height; y++)\n                {\n                    Color a = baseLayer.GetPixel(x, y);\n                    Color b = layer.GetPixel(x, y);\n\n                    Color c = new Color();\n\n                    c.r = Lighten(a.r, b.r);\n                    c.g = Lighten(a.g, b.g);\n                    c.b = Lighten(a.b, b.b);\n\n                    c = ((1f - b.a) * a) + (b.a * c);\n                    c.a = a.a + b.a * (1f - a.a);\n\n                    newLayer.SetPixel(x, y, c);\n                }\n            }\n\n            newLayer.Apply();\n\n            return newLayer;\n        }\n\n        public static Texture2D ColorDodge(Texture2D baseLayer, Texture2D layer)\n        {\n            Texture2D newLayer = new Texture2D(baseLayer.width, baseLayer.height);\n\n            for (int x = 0; x < baseLayer.width; x++)\n            {\n                for (int y = 0; y < baseLayer.height; y++)\n                {\n                    Color a = baseLayer.GetPixel(x, y);\n                    Color b = layer.GetPixel(x, y);\n\n                    Color c = new Color();\n\n\n                    c.r = ColorDodge(a.r, b.r);\n                    c.g = ColorDodge(a.g, b.g);\n                    c.b = ColorDodge(a.b, b.b);\n\n                    c = ((1f - b.a) * a) + (b.a * c);\n                    c.a = a.a + b.a * (1f - a.a);\n\n                    newLayer.SetPixel(x, y, c);\n                }\n            }\n\n            newLayer.Apply();\n\n            return newLayer;\n        }\n\n        public static Texture2D ColorBurn(Texture2D baseLayer, Texture2D layer)\n        {\n            Texture2D newLayer = new Texture2D(baseLayer.width, baseLayer.height);\n\n            for (int x = 0; x < baseLayer.width; x++)\n            {\n                for (int y = 0; y < baseLayer.height; y++)\n                {\n                    Color a = baseLayer.GetPixel(x, y);\n                    Color b = layer.GetPixel(x, y);\n\n                    Color c = new Color();\n\n                    c.r = ColorBurn(a.r, b.r);\n                    c.g = ColorBurn(a.g, b.g);\n                    c.b = ColorBurn(a.b, b.b);\n                    \n                    c = ((1f - b.a) * a) + (b.a * c);\n                    c.a = a.a + b.a * (1f - a.a);\n\n                    newLayer.SetPixel(x, y, c);\n                }\n            }\n\n            newLayer.Apply();\n\n            return newLayer;\n        }\n\n        public static Texture2D HardLight(Texture2D baseLayer, Texture2D layer)\n        {\n            Texture2D newLayer = new Texture2D(baseLayer.width, baseLayer.height);\n\n            for (int x = 0; x < baseLayer.width; x++)\n            {\n                for (int y = 0; y < baseLayer.height; y++)\n                {\n                    Color a = baseLayer.GetPixel(x, y);\n                    Color b = layer.GetPixel(x, y);\n\n                    Color c = new Color();\n\n                    c.r = HardLight(a.r, b.r);\n                    c.g = HardLight(a.g, b.g);\n                    c.b = HardLight(a.b, b.b);\n\n                    c = ((1f - b.a) * a) + (b.a * c);\n                    c.a = a.a + b.a * (1f - a.a);\n\n                    newLayer.SetPixel(x, y, c);\n                }\n            }\n\n            newLayer.Apply();\n\n            return newLayer;\n        }\n\n        public static Texture2D SoftLight(Texture2D baseLayer, Texture2D layer)\n        {\n            Texture2D newLayer = new Texture2D(baseLayer.width, baseLayer.height);\n\n            for (int x = 0; x < baseLayer.width; x++)\n            {\n                for (int y = 0; y < baseLayer.height; y++)\n                {\n                    Color a = baseLayer.GetPixel(x, y);\n                    Color b = layer.GetPixel(x, y);\n\n                    Color c = new Color();\n\n                    c.r = SoftLight(a.r, b.r);\n                    c.g = SoftLight(a.g, b.g);\n                    c.b = SoftLight(a.b, b.b);\n\n                    c = ((1f - b.a) * a) + (b.a * c);\n                    c.a = a.a + b.a * (1f - a.a);\n\n                    newLayer.SetPixel(x, y, c);\n                }\n            }\n\n            newLayer.Apply();\n\n            return newLayer;\n        }\n\n        public static Texture2D Difference(Texture2D baseLayer, Texture2D layer)\n        {\n            Texture2D newLayer = new Texture2D(baseLayer.width, baseLayer.height);\n\n            for (int x = 0; x < baseLayer.width; x++)\n            {\n                for (int y = 0; y < baseLayer.height; y++)\n                {\n                    Color a = baseLayer.GetPixel(x, y);\n                    Color b = layer.GetPixel(x, y);\n\n                    Color c = new Color();\n\n                    c.r = Difference(a.r, b.r);\n                    c.g = Difference(a.g, b.g);\n                    c.b = Difference(a.b, b.b);\n\n                    c = ((1f - b.a) * a) + (b.a * c);\n                    c.a = a.a + b.a * (1f - a.a);\n\n                    newLayer.SetPixel(x, y, c);\n                }\n            }\n\n            newLayer.Apply();\n\n            return newLayer;\n        }\n\n        public static Texture2D Exclusion(Texture2D baseLayer, Texture2D layer)\n        {\n            Texture2D newLayer = new Texture2D(baseLayer.width, baseLayer.height);\n\n            for (int x = 0; x < baseLayer.width; x++)\n            {\n                for (int y = 0; y < baseLayer.height; y++)\n                {\n                    Color a = baseLayer.GetPixel(x, y);\n                    Color b = layer.GetPixel(x, y);\n\n                    Color c = new Color();\n\n                    c.r = Exclusion(a.r, b.r);\n                    c.g = Exclusion(a.g, b.g);\n                    c.b = Exclusion(a.b, b.b);\n\n                    c = ((1f - b.a) * a) + (b.a * c);\n                    c.a = a.a + b.a * (1f - a.a);\n\n                    newLayer.SetPixel(x, y, c);\n                }\n            }\n\n            newLayer.Apply();\n\n            return newLayer;\n        }\n\n\n\n        public static Texture2D Hue(Texture2D baseLayer, Texture2D layer)\n        {\n            Texture2D newLayer = new Texture2D(baseLayer.width, baseLayer.height);\n\n            for (int x = 0; x < baseLayer.width; x++)\n            {\n                for (int y = 0; y < baseLayer.height; y++)\n                {\n                    Color a = baseLayer.GetPixel(x, y);\n                    Color b = layer.GetPixel(x, y);\n\n                    var s = Sat(a);\n                    var l = Lum(a);\n\n                    Color c = SetLum(SetSat(b, s), l);\n\n                    c = ((1f - b.a) * a) + (b.a * c);\n                    c.a = a.a + b.a * (1f - a.a);\n\n                    newLayer.SetPixel(x, y, c);\n                }\n            }\n\n            newLayer.Apply();\n\n            return newLayer;\n        }\n\n        public static Texture2D Saturation(Texture2D baseLayer, Texture2D layer)\n        {\n            Texture2D newLayer = new Texture2D(baseLayer.width, baseLayer.height);\n\n            for (int x = 0; x < baseLayer.width; x++)\n            {\n                for (int y = 0; y < baseLayer.height; y++)\n                {\n                    Color a = baseLayer.GetPixel(x, y);\n                    Color b = layer.GetPixel(x, y);\n\n                    var s = Sat(b);\n                    var l = Lum(a);\n\n                    Color c = SetLum(SetSat(a, s), l);\n\n                    c = ((1f - b.a) * a) + (b.a * c);\n                    c.a = a.a + b.a * (1f - a.a);\n\n                    newLayer.SetPixel(x, y, c);\n                }\n            }\n\n            newLayer.Apply();\n\n            return newLayer;\n        }\n\n        public static Texture2D Color(Texture2D baseLayer, Texture2D layer)\n        {\n            Texture2D newLayer = new Texture2D(baseLayer.width, baseLayer.height);\n\n            for (int x = 0; x < baseLayer.width; x++)\n            {\n                for (int y = 0; y < baseLayer.height; y++)\n                {\n                    Color a = baseLayer.GetPixel(x, y);\n                    Color b = layer.GetPixel(x, y);\n\n                    Color c = SetLum(b, Lum(a));\n\n                    c = ((1f - b.a) * a) + (b.a * c);\n                    c.a = a.a + b.a * (1f - a.a);\n\n                    newLayer.SetPixel(x, y, c);\n                }\n            }\n\n            newLayer.Apply();\n\n            return newLayer;\n        }\n\n        public static Texture2D Luminosity(Texture2D baseLayer, Texture2D layer)\n        {\n            Texture2D newLayer = new Texture2D(baseLayer.width, baseLayer.height);\n\n            for (int x = 0; x < baseLayer.width; x++)\n            {\n                for (int y = 0; y < baseLayer.height; y++)\n                {\n                    Color a = baseLayer.GetPixel(x, y);\n                    Color b = layer.GetPixel(x, y);\n\n\n\n                    Color c = SetLum(a, Lum(b));\n\n                    c = ((1f - b.a) * a) + (b.a * c); ;\n                    c.a = a.a + b.a * (1f - a.a);\n\n                    newLayer.SetPixel(x, y, c);\n                }\n            }\n\n            newLayer.Apply();\n\n            return newLayer;\n        }\n\n\n        public static Texture2D Addition(Texture2D baseLayer, Texture2D layer)\n        {\n            Texture2D newLayer = new Texture2D(baseLayer.width, baseLayer.height);\n\n            for (int x = 0; x < baseLayer.width; x++)\n            {\n                for (int y = 0; y < baseLayer.height; y++)\n                {\n                    Color a = baseLayer.GetPixel(x, y);\n                    Color b = layer.GetPixel(x, y);\n\n                    Color c = a + b;\n\n                    c = ((1f - b.a) * a) + (b.a * c); ;\n                    c.a = a.a + b.a * (1f - a.a);\n\n                    newLayer.SetPixel(x, y, c);\n                }\n            }\n\n            newLayer.Apply();\n\n            return newLayer;\n        }\n\n\n        public static Texture2D Subtract(Texture2D baseLayer, Texture2D layer)\n        {\n            Texture2D newLayer = new Texture2D(baseLayer.width, baseLayer.height);\n\n            for (int x = 0; x < baseLayer.width; x++)\n            {\n                for (int y = 0; y < baseLayer.height; y++)\n                {\n                    Color a = baseLayer.GetPixel(x, y);\n                    Color b = layer.GetPixel(x, y);\n\n                    Color c = a - b;\n\n                    c = ((1f - b.a) * a) + (b.a * c); ;\n                    c.a = a.a + b.a * (1f - a.a);\n\n                    newLayer.SetPixel(x, y, c);\n                }\n            }\n\n            newLayer.Apply();\n\n            return newLayer;\n        }\n\n\n        public static Texture2D Divide(Texture2D baseLayer, Texture2D layer)\n        {\n            Texture2D newLayer = new Texture2D(baseLayer.width, baseLayer.height);\n\n            for (int x = 0; x < baseLayer.width; x++)\n            {\n                for (int y = 0; y < baseLayer.height; y++)\n                {\n                    Color a = baseLayer.GetPixel(x, y);\n                    Color b = layer.GetPixel(x, y);\n\n                    Color c = new Color(\n                        BlendDivide(a.r, b.r),\n                        BlendDivide(a.g, b.g),\n                        BlendDivide(a.b, b.b)\n                        );\n\n                    c = ((1f - b.a) * a) + (b.a * c); ;\n                    c.a = a.a + b.a * (1f - a.a);\n\n                    newLayer.SetPixel(x, y, c);\n                }\n            }\n\n            newLayer.Apply();\n\n            return newLayer;\n        }\n\n        private static float BlendDivide(float b, float s)\n        {\n            if (b == 0)\n                return 0;\n            else if (b >= s)\n                return 255;\n            else\n                return b / s;\n        }\n\n\n        private static double Lum(Color c)\n        {\n            return (0.3 * c.r) + (0.59 * c.g) + (0.11 * c.b);\n        }\n\n        private static Color ClipColor(Color c)\n        {\n            double l = Lum(c);\n            float n = Math.Min(c.r, Math.Min(c.g, c.b));\n            float x = Math.Max(c.r, Math.Max(c.g, c.b));\n\n\n            if (n < 0)\n            {\n                c.r = (float)(l + (((c.r - l) * l) / (l - n)));\n                c.g = (float)(l + (((c.g - l) * l) / (l - n)));\n                c.b = (float)(l + (((c.b - l) * l) / (l - n)));\n            }\n            if (x > 1)\n            {\n                c.r = (float)(l + (((c.r - l) * (1 - l)) / (x - l)));\n                c.g = (float)(l + (((c.g - l) * (1 - l)) / (x - l)));\n                c.b = (float)(l + (((c.b - l) * (1 - l)) / (x - l)));\n            }\n\n            return c;\n        }\n\n\n\n\n        private static Color SetLum(Color c, double l)\n        {\n            double d = l - Lum(c);\n            c.r = (float)(c.r + d);\n            c.g = (float)(c.g + d);\n            c.b = (float)(c.b + d);\n\n            return ClipColor(c);\n        }\n\n        private static double Sat(Color c)\n        {\n            return Math.Max(c.r, Math.Max(c.g, c.b)) - Math.Min(c.r, Math.Min(c.g, c.b));\n        }\n\n        private static double DMax(double x, double y) { return (x > y) ? x : y; }\n        private static double DMin(double x, double y) { return (x < y) ? x : y; }\n\n\n\n\n        private static Color SetSat(Color c, double s)\n        {\n            char cMin = GetMinComponent(c);\n            char cMid = GetMidComponent(c);\n            char cMax = GetMaxComponent(c);\n\n            double min = GetComponent(c, cMin);\n            double mid = GetComponent(c, cMid);\n            double max = GetComponent(c, cMax);\n\n\n            if (max > min)\n            {\n                mid = ((mid - min) * s) / (max - min);\n                c = SetComponent(c, cMid, (float)mid);\n                max = s;\n                c = SetComponent(c, cMax, (float)max);\n            }\n            else\n            {\n                mid = max = 0;\n                c = SetComponent(c, cMax, (float)max);\n                c = SetComponent(c, cMid, (float)mid);\n            }\n\n            min = 0;\n            c = SetComponent(c, cMin, (float)min);\n\n            return c;\n        }\n\n\n\n\n        private static float GetComponent(Color c, char component)\n        {\n            switch (component)\n            {\n                case 'r': return c.r;\n                case 'g': return c.g;\n                case 'b': return c.b;\n            }\n\n            return 0f;\n        }\n\n\n        private static Color SetComponent(Color c, char component, float value)\n        {\n            switch (component)\n            {\n                case 'r': c.r = value; break;\n                case 'g': c.g = value; break;\n                case 'b': c.b = value; break;\n            }\n\n            return c;\n        }\n\n        private static char GetMinComponent(Color c)\n        {\n            var r = new KeyValuePair<char, float>('r', c.r);\n            var g = new KeyValuePair<char, float>('g', c.g);\n            var b = new KeyValuePair<char, float>('b', c.b);\n\n            return MIN(r, MIN(g, b)).Key;\n        }\n\n        private static char GetMidComponent(Color c)\n        {\n            var r = new KeyValuePair<char, float>('r', c.r);\n            var g = new KeyValuePair<char, float>('g', c.g);\n            var b = new KeyValuePair<char, float>('b', c.b);\n\n            return MID(r, g, b).Key;\n        }\n\n        private static char GetMaxComponent(Color c)\n        {\n            var r = new KeyValuePair<char, float>('r', c.r);\n            var g = new KeyValuePair<char, float>('g', c.g);\n            var b = new KeyValuePair<char, float>('b', c.b);\n\n            return MAX(r, MAX(g, b)).Key;\n        }\n\n        private static KeyValuePair<char, float> MIN(KeyValuePair<char, float> x, KeyValuePair<char, float> y)\n        {\n            return (x.Value < y.Value) ? x : y;\n        }\n\n        private static KeyValuePair<char, float> MAX(KeyValuePair<char, float> x, KeyValuePair<char, float> y)\n        {\n            return (x.Value > y.Value) ? x : y;\n        }\n\n        private static KeyValuePair<char, float> MID(KeyValuePair<char, float> x, KeyValuePair<char, float> y, KeyValuePair<char, float> z)\n        {\n            List<KeyValuePair<char, float>> components = new List<KeyValuePair<char, float>>();\n            components.Add(x);\n            components.Add(z);\n            components.Add(y);\n            \n\n            components.Sort((c1, c2) => { return c1.Value.CompareTo(c2.Value); });\n\n            return components[1];\n            //return MAX(x, MIN(y, z));\n        }\n    }\n}\n\n"
  },
  {
    "path": "Editor/Aseprite/Utils/Texture2DBlender.cs.meta",
    "content": "fileFormatVersion: 2\nguid: b0ee26c61a0ff1440a985110f81ff183\nMonoImporter:\n  externalObjects: {}\n  serializedVersion: 2\n  defaultReferences: []\n  executionOrder: 0\n  icon: {instanceID: 0}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "Editor/Aseprite/Utils/Texture2DUtil.cs",
    "content": "using UnityEngine;\n\nnamespace Aseprite.Utils\n{\n    public class Texture2DUtil\n    {\n        public static Texture2D CreateTransparentTexture(int width, int height)\n        {\n            Texture2D texture = new Texture2D(width, height, TextureFormat.RGBA32, false);\n            Color[] pixels = new UnityEngine.Color[width * height];\n\n            for (int i = 0; i < pixels.Length; i++) pixels[i] = UnityEngine.Color.clear;\n\n            texture.SetPixels(pixels);\n            texture.Apply();\n\n            return texture;\n        }       \n    }\n}"
  },
  {
    "path": "Editor/Aseprite/Utils/Texture2DUtil.cs.meta",
    "content": "fileFormatVersion: 2\nguid: 273011f266bf5364d8199528934ac6f6\nMonoImporter:\n  externalObjects: {}\n  serializedVersion: 2\n  defaultReferences: []\n  executionOrder: 0\n  icon: {instanceID: 0}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "Editor/Aseprite/Utils.meta",
    "content": "fileFormatVersion: 2\nguid: 63d5de14348548f44b04ec0d5a578eed\nfolderAsset: yes\nDefaultImporter:\n  externalObjects: {}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "Editor/Aseprite.meta",
    "content": "fileFormatVersion: 2\nguid: 39608fc27a7b640f3bb2583f2c5d3d65\nfolderAsset: yes\nDefaultImporter:\n  externalObjects: {}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "Editor/AsepriteImporter.Editor.asmdef",
    "content": "{\n    \"name\": \"AsepriteImporter.Editor\",\n    \"rootNamespace\": \"AsepriteImporter\",\n    \"references\": [\n        \"Unity.2D.Sprite.Editor\"\n    ],\n    \"includePlatforms\": [\n        \"Editor\"\n    ],\n    \"excludePlatforms\": [],\n    \"allowUnsafeCode\": false,\n    \"overrideReferences\": false,\n    \"precompiledReferences\": [],\n    \"autoReferenced\": true,\n    \"defineConstraints\": [],\n    \"versionDefines\": [],\n    \"noEngineReferences\": false\n}"
  },
  {
    "path": "Editor/AsepriteImporter.Editor.asmdef.meta",
    "content": "fileFormatVersion: 2\nguid: c761a2883f98a4d9f9dfcf240cf74ec5\nAssemblyDefinitionImporter:\n  externalObjects: {}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "Editor/Data/AseFileSpriteImportData.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing UnityEngine;\n\n#if UNITY_2020_2_OR_NEWER\nusing UnityEditor.AssetImporters;\n#else\nusing UnityEditor.Experimental.AssetImporters;\n#endif\n\n\nnamespace AsepriteImporter.Data\n{\n    [Serializable]\n    public class AseFileSpriteImportData\n    {\n        public string name;\n\n        //     Position and size of the Sprite in a given texture.\n        public Rect rect;\n\n        //     Pivot value represented by SpriteAlignment.\n        public SpriteAlignment alignment;\n\n        //     Pivot value represented in Vector2.\n        public Vector2 pivot;\n\n        //     Border value for the generated Sprite.\n        public Vector4 border;\n\n        //     Sprite Asset creation uses this outline when it generates the Mesh for the Sprite.\n        //     If this is not given, SpriteImportData.tesselationDetail will be used to determine\n        //     the mesh detail.\n        public List<Vector2[]> outline;\n\n        //     Controls mesh generation detail. This value will be ignored if SpriteImportData.ouline\n        //     is provided.\n        public float tessellationDetail;\n\n        //     An identifier given to a Sprite. Use this to identify which data was used to\n        //     generate that Sprite.\n        public string spriteID;\n\n\n        public SpriteImportData ToSpriteImportData()\n        {\n            return new SpriteImportData()\n            {\n                alignment = alignment,\n                border = border,\n                name = name,\n                outline = outline,\n                pivot = pivot,\n                rect = rect,\n                spriteID = spriteID,\n                tessellationDetail = tessellationDetail\n            };\n        }\n    }\n}"
  },
  {
    "path": "Editor/Data/AseFileSpriteImportData.cs.meta",
    "content": "﻿fileFormatVersion: 2\nguid: 5f147ff7a3254c4f990835c7fdd91b74\ntimeCreated: 1609174803"
  },
  {
    "path": "Editor/Data.meta",
    "content": "﻿fileFormatVersion: 2\nguid: edba485a2e844ac080f092c523f3d2be\ntimeCreated: 1609174781"
  },
  {
    "path": "Editor/DataProviders/AsepriteOutlineDataProvider.cs",
    "content": "﻿using System.Collections.Generic;\nusing AsepriteImporter.Data;\nusing UnityEditor;\nusing UnityEditor.U2D.Sprites;\nusing UnityEngine;\n\nnamespace AsepriteImporter.DataProviders\n{\n    public class AsepriteOutlineDataProvider : ISpriteOutlineDataProvider\n    {\n        private readonly AseFileImporter importer;\n\n        public AsepriteOutlineDataProvider(AseFileImporter importer)\n        {\n            this.importer = importer;\n        }\n        public List<Vector2[]> GetOutlines(GUID guid)\n        {\n            foreach (AseFileSpriteImportData data in importer.SpriteImportData)\n            {\n                if (data.spriteID == guid.ToString())\n                {\n                    return data.outline;\n                }\n            }\n\n            return new List<Vector2[]>();\n        }\n\n        public float GetTessellationDetail(GUID guid)\n        {\n            for (int i = 0; i < importer.SpriteImportData.Length; i++)\n            {\n                if (importer.SpriteImportData[i].spriteID == guid.ToString())\n                {\n                    return importer.SpriteImportData[i].tessellationDetail;\n                }\n            }\n\n            return 0f;\n        }\n\n        public void SetOutlines(GUID guid, List<Vector2[]> data)\n        {\n            for (int i = 0; i < importer.SpriteImportData.Length; i++)\n            {\n                if (importer.SpriteImportData[i].spriteID == guid.ToString())\n                {\n                    importer.SpriteImportData[i].outline = data;\n                }\n            }\n        }\n\n        public void SetTessellationDetail(GUID guid, float value)\n        {\n            for (int i = 0; i < importer.SpriteImportData.Length; i++)\n            {\n                if (importer.SpriteImportData[i].spriteID == guid.ToString())\n                {\n                    importer.SpriteImportData[i].tessellationDetail = value;\n                }\n            }\n        }\n    }\n}"
  },
  {
    "path": "Editor/DataProviders/AsepriteOutlineDataProvider.cs.meta",
    "content": "﻿fileFormatVersion: 2\nguid: 6039c5cf3e544266a0152470a889ece6\ntimeCreated: 1609175701"
  },
  {
    "path": "Editor/DataProviders/AsepriteTextureDataProvider.cs",
    "content": "﻿using UnityEditor;\nusing UnityEditor.U2D.Sprites;\nusing UnityEngine;\n\nnamespace AsepriteImporter.DataProviders\n{\n    public class AsepriteTextureDataProvider : ITextureDataProvider\n    {\n        private readonly AseFileImporter aseFileImporter;\n\n        public AsepriteTextureDataProvider(AseFileImporter aseFileImporter)\n        {\n            this.aseFileImporter = aseFileImporter;\n        }\n\n        public Texture2D texture => aseFileImporter.Texture;\n\n        public Texture2D previewTexture => aseFileImporter.Texture;\n\n        public Texture2D GetReadableTexture2D()\n        {\n            if (aseFileImporter.textureImporterSettings.spriteMode == (int)SpriteImportMode.Multiple)\n            {\n                return aseFileImporter.Texture;\n            }\n            return null;\n        }\n\n        public void GetTextureActualWidthAndHeight(out int width, out int height)\n        {\n            width = aseFileImporter.Texture.width;\n            height = aseFileImporter.Texture.height;\n        }\n    }\n}"
  },
  {
    "path": "Editor/DataProviders/AsepriteTextureDataProvider.cs.meta",
    "content": "﻿fileFormatVersion: 2\nguid: 796bd9cbf63e4521afe47c82a2068493\ntimeCreated: 1609176009"
  },
  {
    "path": "Editor/DataProviders.meta",
    "content": "﻿fileFormatVersion: 2\nguid: ad39f95ce164409ba941afa486e1dda5\ntimeCreated: 1609175572"
  },
  {
    "path": "Editor/EditorUtils/TextureImporterEditorUtils.cs",
    "content": "﻿using System.Collections.Generic;\n\nnamespace AsepriteImporter.EditorUtils\n{\n    public class TextureImporterEditorUtils\n    {\n        internal enum TextureImportTypeIndex\n        {\n            Default = 0,\n            Image = 1,\n            NormalMap = 2,\n            Bump = 3,\n            GUI = 4,\n            Cubemap = 5,\n            Reflection = 6,\n            Cookie = 7,\n            Advanced = 8,\n            Lightmap = 9,\n            Cursor = 10,\n            Sprite = 11,\n            HDRI = 12,\n            SingleChannel = 13\n        }\n\n        internal static readonly Dictionary<int, string> mappingGenerationType = new Dictionary<int, string>\n        {\n            { 0, \"Sprite\" },\n        };\n\n        internal static readonly Dictionary<int, string> MappingTextureImportTypes = new Dictionary<int, string>\n        {\n            { (int)TextureImportTypeIndex.Default, \"Default\" },\n            { (int)TextureImportTypeIndex.NormalMap, \"Normal map\" },\n            { (int)TextureImportTypeIndex.GUI, \"Editor GUI and Legacy GUI\" },\n            { (int)TextureImportTypeIndex.Sprite, \"Sprite (2D and UI)\" },\n            { (int)TextureImportTypeIndex.Cursor, \"Cursor\" },\n            { (int)TextureImportTypeIndex.Cookie, \"Cookie\" },\n            { (int)TextureImportTypeIndex.Lightmap, \"Lightmap\" },\n            { (int)TextureImportTypeIndex.SingleChannel, \"Single Channel\" },\n        };\n\n        internal static readonly Dictionary<int, string> mappingTextureShapes = new Dictionary<int, string>\n        {\n            { 0, \"2D\" },\n            { 1, \"Cube\" },\n        };\n\n        internal static readonly Dictionary<int, string> mappingAlphaSource = new Dictionary<int, string>\n        {\n            { 0, \"None\" },\n            { 1, \"Input Texture Alpha\" },\n            { 2, \"From Gray Scale\" },\n        };\n\n        internal static readonly Dictionary<int, string> mappingMipMapFilter = new Dictionary<int, string>\n        {\n            { 0, \"Box\" },\n            { 1, \"Kaiser\" },\n        };\n\n        internal static readonly Dictionary<int, string> mappingFilterMode = new Dictionary<int, string>\n        {\n            { 0, \"Point (no filter)\" },\n            { 1, \"Bilinear\" },\n            { 2, \"Trilinear\" },\n        };\n\n        internal static readonly int[] textureType2DFixed = { 4, 5, 6, 7, 8, 9, 10, 11, 12 };\n        internal static readonly int[] textureTypeAnisoEnabled =\n        {\n            (int)TextureImportTypeIndex.Default,\n            (int)TextureImportTypeIndex.NormalMap\n        };\n    }\n}"
  },
  {
    "path": "Editor/EditorUtils/TextureImporterEditorUtils.cs.meta",
    "content": "﻿fileFormatVersion: 2\nguid: c8bf5d8e9e1e4c1eb5ef545f56e0a81a\ntimeCreated: 1609162319"
  },
  {
    "path": "Editor/EditorUtils.meta",
    "content": "﻿fileFormatVersion: 2\nguid: 087adb5ecf5941c6a9b90d5b795dcc0a\ntimeCreated: 1609162277"
  },
  {
    "path": "Editor/Editors/BundledImporterEditor.cs",
    "content": "﻿using System;\nusing System.Linq;\nusing AsepriteImporter.EditorUtils;\nusing AsepriteImporter.Settings;\nusing UnityEditor;\nusing UnityEngine;\n\nnamespace AsepriteImporter.Editors\n{\n    public class BundledImporterEditor : SpriteImporterEditor\n    {\n        private const string FoldoutTextureAdvanced = \"textureSettingsAdvanced\";\n        \n        private readonly string[] editorTabs = {\"Texture\", \"Animation\"};\n        private int activeTab = 0;\n        \n        protected override void OnInspectorGUI()\n        {\n            if (Importer.textureImporterSettings == null)\n                Importer.textureImporterSettings = new AseFileTextureImportSettings();\n\n            activeTab = GUILayout.Toolbar(activeTab, editorTabs);\n\n            switch (activeTab)\n            {\n                case 0:\n                    DrawTextureImporterSettings();\n                    break;\n                case 1:\n                    DrawAnimationImportSettings();\n                    break;\n            }\n        }\n        \n        \n        private void DrawTextureImporterSettings()\n        {\n            EditorGUILayout.Space();\n            EditorGUILayout.LabelField(\"Texture Importer Settings\", EditorStyles.boldLabel);\n            EditorGUILayout.Space();\n\n            SerializedProperty textureType = SerializedObject.FindProperty(TextureSettingsPath + \"textureType\");\n            GUI.enabled = false;\n            if (CustomEnumPopup(\"Texture Type\", textureType, TextureImporterEditorUtils.MappingTextureImportTypes))\n            {\n                Importer.textureImporterSettings.ApplyTextureType(Importer.textureImporterSettings.textureType);\n            }\n\n            GUI.enabled = true;\n\n            SerializedProperty textureShape = SerializedObject.FindProperty(TextureSettingsPath + \"textureShape\");\n\n\n\n            if (TextureImporterEditorUtils.textureType2DFixed.Contains(textureType.enumValueIndex))\n            {\n                GUI.enabled = false;\n                textureShape.enumValueIndex = 0;\n            }\n\n            CustomEnumPopup(\"Texture Shape\", textureShape, TextureImporterEditorUtils.mappingTextureShapes);\n            GUI.enabled = true;\n\n            EditorGUILayout.Space();\n\n            if (textureType.enumValueIndex == (int) TextureImporterEditorUtils.TextureImportTypeIndex.Sprite)\n            {\n                DrawSpriteSettings();\n            }\n\n            DrawAdvancedSettings();\n\n            EditorGUILayout.Space();\n\n            SerializedProperty wrapMode = SerializedObject.FindProperty(TextureSettingsPath + \"wrapMode\");\n            EditorGUILayout.PropertyField(wrapMode);\n\n            SerializedProperty filterMode = SerializedObject.FindProperty(TextureSettingsPath + \"filterMode\");\n            CustomEnumPopup(\"Filter Mode\", filterMode, TextureImporterEditorUtils.mappingFilterMode);\n\n\n            SerializedProperty aniso = SerializedObject.FindProperty(TextureSettingsPath + \"aniso\");\n            if (!(Array.IndexOf(TextureImporterEditorUtils.textureTypeAnisoEnabled, textureType.enumValueIndex) != -1 &&\n                  filterMode.enumValueIndex != 0))\n            {\n                GUI.enabled = false;\n            }\n\n            aniso.intValue = (int) EditorGUILayout.Slider(\"Aniso Level\", aniso.intValue, 0, 16);\n            GUI.enabled = true;\n        }\n        \n        private void DrawSpriteSettings()\n        {\n            SerializedProperty spriteMode = SerializedObject.FindProperty(TextureSettingsPath + \"spriteMode\");\n            spriteMode.intValue = EditorGUILayout.Popup(\"Sprite Mode\", spriteMode.intValue, Enum.GetNames(typeof(SpriteImportMode)));\n\n            ++EditorGUI.indentLevel;\n\n            SerializedProperty pixelsPerUnit = SerializedObject.FindProperty(TextureSettingsPath + \"spritePixelsPerUnit\");\n            EditorGUILayout.PropertyField(pixelsPerUnit, new GUIContent(\"Pixels Per Unit\"));\n\n            SerializedProperty meshType = SerializedObject.FindProperty(TextureSettingsPath + \"spriteMeshType\");\n            EditorGUILayout.PropertyField(meshType, new GUIContent(\"Mesh Type\"));\n\n            SerializedProperty extrudeEdges = SerializedObject.FindProperty(TextureSettingsPath + \"spriteExtrude\");\n            EditorGUILayout.IntSlider(extrudeEdges, 0, 32, new GUIContent(\"Extrude Edges\"));\n\n            SerializedProperty pivot = SerializedObject.FindProperty(TextureSettingsPath + \"spriteAlignment\");\n            pivot.intValue = EditorGUILayout.Popup(\"Pivot\", pivot.intValue, Enum.GetNames(typeof(SpriteAlignment)));\n\n            if (pivot.intValue == (int)SpriteAlignment.Custom)\n            {\n                SerializedProperty spritePivot = SerializedObject.FindProperty(TextureSettingsPath + \"spritePivot\");\n                EditorGUILayout.PropertyField(spritePivot, new GUIContent(\" \"));\n            }\n\n            SerializedProperty generatePhysics = SerializedObject.FindProperty(TextureSettingsPath + \"spriteGenerateFallbackPhysicsShape\");\n            EditorGUILayout.PropertyField(generatePhysics, new GUIContent(\"Generate Physics Shape\"));\n\n            DrawSpriteEditorButton();\n\n            --EditorGUI.indentLevel;\n        }\n        \n\n        private void DrawAdvancedSettings()\n        {\n            if (!foldoutStates.ContainsKey(FoldoutTextureAdvanced))\n                foldoutStates.Add(FoldoutTextureAdvanced, false);\n\n            foldoutStates[FoldoutTextureAdvanced] =\n                EditorGUILayout.Foldout(foldoutStates[FoldoutTextureAdvanced], \"Advanced\");\n            if (foldoutStates[FoldoutTextureAdvanced])\n            {\n                ++EditorGUI.indentLevel;\n\n                SerializedProperty srgbTexture = SerializedObject.FindProperty(TextureSettingsPath + \"sRGBTexture\");\n                EditorGUILayout.PropertyField(srgbTexture, new GUIContent(\"sRGB (Color Texture)\"));\n\n                SerializedProperty alphaSource = SerializedObject.FindProperty(TextureSettingsPath + \"alphaSource\");\n                CustomEnumPopup(\"Alpha Source\", alphaSource, TextureImporterEditorUtils.mappingAlphaSource);\n\n                if (alphaSource.enumValueIndex == 0)\n                    GUI.enabled = false;\n                SerializedProperty alphaIsTransparency =\n                    SerializedObject.FindProperty(TextureSettingsPath + \"alphaIsTransparency\");\n                EditorGUILayout.PropertyField(alphaIsTransparency);\n                GUI.enabled = true;\n\n                SerializedProperty readable = SerializedObject.FindProperty(TextureSettingsPath + \"readable\");\n                EditorGUILayout.PropertyField(readable, new GUIContent(\"Read/Write Enabled\"));\n\n                SerializedProperty mipmapEnabled =\n                    SerializedObject.FindProperty(TextureSettingsPath + \"mipmapEnabled\");\n                EditorGUILayout.PropertyField(mipmapEnabled, new GUIContent(\"Generate Mip Maps\"));\n\n                if (mipmapEnabled.boolValue)\n                {\n                    ++EditorGUI.indentLevel;\n\n                    SerializedProperty borderMipmap =\n                        SerializedObject.FindProperty(TextureSettingsPath + \"borderMipmap\");\n                    EditorGUILayout.PropertyField(borderMipmap, new GUIContent(\"Border Mip Maps\"));\n\n                    SerializedProperty mipmapFilter =\n                        SerializedObject.FindProperty(TextureSettingsPath + \"mipmapFilter\");\n                    CustomEnumPopup(\"Mip Map Filtering\", mipmapFilter, TextureImporterEditorUtils.mappingMipMapFilter);\n\n                    SerializedProperty mipMapsPreserveCoverage =\n                        SerializedObject.FindProperty(TextureSettingsPath + \"mipMapsPreserveCoverage\");\n                    EditorGUILayout.PropertyField(mipMapsPreserveCoverage);\n\n                    if (mipMapsPreserveCoverage.boolValue)\n                    {\n                        ++EditorGUI.indentLevel;\n\n                        SerializedProperty mipmapBias =\n                            SerializedObject.FindProperty(TextureSettingsPath + \"mipmapBias\");\n                        EditorGUILayout.PropertyField(mipmapBias, new GUIContent(\"Alpha Cutoff Value\"));\n\n                        --EditorGUI.indentLevel;\n                    }\n\n\n                    SerializedProperty fadeOut = SerializedObject.FindProperty(TextureSettingsPath + \"fadeOut\");\n                    EditorGUILayout.PropertyField(fadeOut, new GUIContent(\"Fadeout Mip Maps\"));\n\n                    if (fadeOut.boolValue)\n                    {\n                        ++EditorGUI.indentLevel;\n\n                        SerializedProperty mipmapFadeDistanceStart =\n                            SerializedObject.FindProperty(TextureSettingsPath + \"mipmapFadeDistanceStart\");\n                        SerializedProperty mipmapFadeDistanceEnd =\n                            SerializedObject.FindProperty(TextureSettingsPath + \"mipmapFadeDistanceEnd\");\n\n                        float fadeStart = mipmapFadeDistanceStart.intValue;\n                        float fadeEnd = mipmapFadeDistanceEnd.intValue;\n\n                        EditorGUILayout.MinMaxSlider(\"Fade Range\", ref fadeStart, ref fadeEnd, 0, 10);\n\n                        mipmapFadeDistanceStart.intValue = (int) fadeStart;\n                        mipmapFadeDistanceEnd.intValue = (int) fadeEnd;\n\n                        --EditorGUI.indentLevel;\n                    }\n\n                    --EditorGUI.indentLevel;\n                }\n\n                --EditorGUI.indentLevel;\n            }\n        }\n\n\n\n        private void DrawAnimationImportSettings()\n        {\n            SerializedProperty animationSettingsArray = SerializedObject.FindProperty(\"animationSettings\");\n            EditorGUILayout.Space();\n            EditorGUILayout.LabelField(\"Animation Import Settings\", EditorStyles.boldLabel);\n            \n            if (animationSettingsArray != null)\n            {\n                int arraySize = animationSettingsArray.arraySize;\n                if (arraySize == 0)\n                {\n                    EditorGUILayout.HelpBox($\"\\\"{Importer.name}\\\" does not contain any animation\", MessageType.None);\n                    return;\n                }\n\n                SerializedProperty generateAnimations = SerializedObject.FindProperty(\"settings.generateAnimations\");\n                EditorGUILayout.PropertyField(generateAnimations);\n\n                /* Not implemented yet\n                SerializedProperty createAnimationAssets = SerializedObject.FindProperty(\"settings.createAnimationAssets\");\n                EditorGUILayout.PropertyField(createAnimationAssets);\n                */\n                \n                GUI.enabled = generateAnimations.boolValue;\n                ++EditorGUI.indentLevel;\n                for (int i = 0; i < arraySize; i++)\n                {\n                    DrawAnimationSetting(animationSettingsArray.GetArrayElementAtIndex(i),\n                        Importer.animationSettings[i]);\n                }\n\n                --EditorGUI.indentLevel;\n                GUI.enabled = true;\n            }\n        }\n\n        private void DrawAnimationSetting(SerializedProperty animationSettingProperty,\n            AseFileAnimationSettings animationSetting)\n        {\n            string animationName = animationSettingProperty.FindPropertyRelative(\"animationName\").stringValue;\n\n            if (animationName == null)\n                return;\n\n\n\n            if (!foldoutStates.ContainsKey(animationName))\n            {\n                foldoutStates.Add(animationName, false);\n            }\n\n            EditorGUILayout.BeginVertical(GUI.skin.box);\n            EditorGUI.indentLevel++;\n\n            GUIStyle foldoutStyle = EditorStyles.foldout;\n            FontStyle prevoiusFontStyle = foldoutStyle.fontStyle;\n            foldoutStyle.fontStyle = FontStyle.Bold;\n\n            var content = new GUIContent();\n            content.text = animationName;\n\n            if (animationSetting.HasInvalidSprites)\n                content.image = EditorGUIUtility.IconContent(\"console.warnicon.sml\").image;\n\n\n            if (foldoutStates[animationName] = EditorGUILayout.Foldout(foldoutStates[animationName],\n                content, true, foldoutStyle))\n            {\n                if (animationSetting.HasInvalidSprites)\n                    EditorGUILayout.HelpBox(\n                        $\"The animation '{animationName}' will not be imported.\\nSome sprites are missing.\",\n                        MessageType.Warning);\n\n\n                EditorGUILayout.PropertyField(animationSettingProperty.FindPropertyRelative(\"loopTime\"));\n                EditorGUILayout.HelpBox(animationSettingProperty.FindPropertyRelative(\"about\").stringValue,\n                    MessageType.None);\n\n                SerializedProperty sprites = animationSettingProperty.FindPropertyRelative(\"sprites\");\n                SerializedProperty frameNumbers = animationSettingProperty.FindPropertyRelative(\"frameNumbers\");\n\n                for (int i = 0; i < sprites.arraySize; i++)\n                {\n                    EditorGUILayout.PropertyField(sprites.GetArrayElementAtIndex(i),\n                        new GUIContent(\"Frame #\" + frameNumbers.GetArrayElementAtIndex(i).intValue));\n                }\n            }\n\n            foldoutStyle.fontStyle = prevoiusFontStyle;\n\n            EditorGUI.indentLevel--;\n            EditorGUILayout.EndVertical();\n        }\n    \n\n\n\n        private void DrawSpriteEditorButton()\n         {\n             Rect spriteEditorRect = EditorGUILayout.GetControlRect(false);\n             Rect spriteEditorButtonRect = new Rect(spriteEditorRect.xMax - 80, spriteEditorRect.y, 80, spriteEditorRect.height);\n             if (GUI.Button(spriteEditorButtonRect, \"Sprite Editor\"))\n             {\n                 if (EditorUtility.IsDirty(SerializedObject.targetObject.GetInstanceID()))\n                 {\n                     var assetPath = (SerializedObject.targetObject as AseFileImporter).assetPath;\n\n                     if (EditorUtility.DisplayDialog(\"Unapplied import settings\", $\"Unapplied import settings for {assetPath}.\\nApply and continue to sprite editor or cancel.\", \"Apply\", \"Cancel\"))\n                     {\n                         ApplyAndImport();\n                     }\n                     else\n                     {\n                         return;\n                     }\n                 }\n\n                 EditorApplication.ExecuteMenuItem(\"Window/2D/Sprite Editor\");\n\n                 GUIUtility.ExitGUI();\n             }\n\n             EditorGUILayout.Space();\n         }\n    }\n}"
  },
  {
    "path": "Editor/Editors/BundledImporterEditor.cs.meta",
    "content": "﻿fileFormatVersion: 2\nguid: 52dd1da487c249c684ce55fcda3727c0\ntimeCreated: 1609170602"
  },
  {
    "path": "Editor/Editors/GeneratedImporterEditor.cs",
    "content": "﻿using UnityEditor;\nusing UnityEngine;\n\nnamespace AsepriteImporter.Editors\n{\n    public class GeneratedImporterEditor : SpriteImporterEditor\n    {\n        private readonly string[] spritePivotOptions =\n        {\n            \"Center\", \"Top Left\", \"Top\", \"Top Right\", \"Left\", \"Right\", \"Bottom Left\", \"Bottom\", \"Bottom Right\", \"Custom\"\n        };\n        \n        private bool customSpritePivot;\n        \n        protected override void OnInspectorGUI()\n        {\n            var settings = \"settings.\";\n\n            EditorGUILayout.LabelField(\"Texture Options\", EditorStyles.boldLabel);\n            {\n                EditorGUI.indentLevel++;\n                var transparencyMode = SerializedObject.FindProperty(settings + \"transparencyMode\");\n                var transparentColor = SerializedObject.FindProperty(settings + \"transparentColor\");\n\n                EditorGUILayout.PropertyField(transparencyMode);\n                if (transparencyMode.intValue == (int) TransparencyMode.Mask)\n                {\n                    EditorGUILayout.BeginHorizontal();\n                    EditorGUILayout.PropertyField(transparentColor);\n                    if (GUILayout.Button(\"Reset\"))\n                    {\n                        transparentColor.colorValue = Color.magenta;\n                    }\n\n                    EditorGUILayout.EndHorizontal();\n                }\n\n                EditorGUILayout.PropertyField(SerializedObject.FindProperty(settings + \"pixelsPerUnit\"));\n\n                if (ImportType == AseFileImportType.Sprite)\n                {\n                    PivotPopup(\"Pivot\");\n                }\n\n                EditorGUI.indentLevel--;\n            }\n            EditorGUILayout.Space();\n\n            if (ImportType == AseFileImportType.Sprite)\n            {\n                EditorGUILayout.LabelField(\"Animation Options\", EditorStyles.boldLabel);\n                EditorGUI.indentLevel++;\n                var bindTypeProperty = SerializedObject.FindProperty(settings + \"bindType\");\n                var bindType = (AseAnimationBindType) bindTypeProperty.intValue;\n\n                EditorGUI.BeginChangeCheck();\n                bindType = (AseAnimationBindType) EditorGUILayout.EnumPopup(\"Bind Type\", bindType);\n\n                var animTypeProperty = SerializedObject.FindProperty(settings + \"animType\");\n                var animType = (AseAnimatorType) animTypeProperty.intValue;\n                animType = (AseAnimatorType) EditorGUILayout.EnumPopup(\"Animator Type\", animType);\n\n                if (animType == AseAnimatorType.AnimatorOverrideController)\n                {\n                    EditorGUILayout.PropertyField(SerializedObject.FindProperty(settings + \"baseAnimator\"));\n                }\n\n                EditorGUILayout.PropertyField(SerializedObject.FindProperty(settings + \"buildAtlas\"));\n\n                if (EditorGUI.EndChangeCheck())\n                {\n                    bindTypeProperty.intValue = (int) bindType;\n                    animTypeProperty.intValue = (int) animType;\n                }\n\n                EditorGUI.indentLevel--;\n            }\n\n            if (ImportType == AseFileImportType.Tileset)\n            {\n                EditorGUILayout.LabelField(\"Tileset Options\", EditorStyles.boldLabel);\n                {\n                    EditorGUI.indentLevel++;\n\n                    EditorGUILayout.PropertyField(SerializedObject.FindProperty(settings + \"tileSize\"));\n                    PivotPopup(\"Tile Pivot\");\n                    EditorGUILayout.PropertyField(SerializedObject.FindProperty(settings + \"tileEmpty\"),\n                        new GUIContent(\"Empty Tile Behaviour\",\n                            \"Behavior for empty tiles:\\nKeep - Keep empty tiles\\nIndex - Remove empty tiles, but still index them\\nRemove - Remove empty tiles completely\"));\n\n                    // tileNameType\n                    var tileNameTypeProperty = SerializedObject.FindProperty(settings + \"tileNameType\");\n                    var tileNameType = (TileNameType) tileNameTypeProperty.enumValueIndex;\n\n                    EditorGUI.BeginChangeCheck();\n                    tileNameType = (TileNameType) EditorGUILayout.EnumPopup(\"TileNameType\", tileNameType);\n                    if (EditorGUI.EndChangeCheck())\n                    {\n                        tileNameTypeProperty.enumValueIndex = (int) tileNameType;\n                    }\n\n                    EditorGUI.indentLevel--;\n                }\n            }\n        }\n        \n        private void PivotPopup(string label) {\n            var alignmentProperty = SerializedObject.FindProperty(\"settings.spriteAlignment\");\n            var pivotProperty = SerializedObject.FindProperty(\"settings.spritePivot\");\n            var pivot = pivotProperty.vector2Value;\n            var alignment = alignmentProperty.intValue;\n\n            EditorGUI.BeginChangeCheck();\n            alignment = EditorGUILayout.Popup(label, alignment, spritePivotOptions);\n            switch (alignment) {\n                case 0:\n                    customSpritePivot = false;\n                    pivot = new Vector2(0.5f, 0.5f);\n                    break;\n                case 1:\n                    customSpritePivot = false;\n                    pivot = new Vector2(0f, 1f);\n                    break;\n                case 2:\n                    customSpritePivot = false;\n                    pivot = new Vector2(0.5f, 1f);\n                    break;\n                case 3:\n                    customSpritePivot = false;\n                    pivot = new Vector2(1f, 1f);\n                    break;\n                case 4:\n                    customSpritePivot = false;\n                    pivot = new Vector2(0f, 0.5f);\n                    break;\n                case 5:\n                    customSpritePivot = false;\n                    pivot = new Vector2(1f, 0.5f);\n                    break;\n                case 6:\n                    customSpritePivot = false;\n                    pivot = new Vector2(0f, 0f);\n                    break;\n                case 7:\n                    customSpritePivot = false;\n                    pivot = new Vector2(0.5f, 0f);\n                    break;\n                case 8:\n                    customSpritePivot = false;\n                    pivot = new Vector2(1f, 0f);\n                    break;\n                default:\n                    customSpritePivot = true;\n                    break;\n            }\n\n            alignmentProperty.intValue = alignment;\n\n            if (customSpritePivot) {\n                EditorGUI.indentLevel++;\n                EditorGUILayout.PropertyField(SerializedObject.FindProperty(\"settings.spritePivot\"),\n                    new GUIContent(label));\n                EditorGUI.indentLevel--;\n            } else if (EditorGUI.EndChangeCheck() && !customSpritePivot) {\n                pivotProperty.vector2Value = pivot;\n            }\n        }\n    }\n}"
  },
  {
    "path": "Editor/Editors/GeneratedImporterEditor.cs.meta",
    "content": "﻿fileFormatVersion: 2\nguid: c4aff49991844f669d1528ce2de4991c\ntimeCreated: 1609170323"
  },
  {
    "path": "Editor/Editors/SpriteImporterEditor.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing UnityEditor;\nusing UnityEngine;\n#if UNITY_2020_2_OR_NEWER\nusing UnityEditor.AssetImporters;\n#else\nusing UnityEditor.Experimental.AssetImporters;\n#endif\n\nnamespace AsepriteImporter.Editors\n{\n    public class SpriteImporterEditor\n    {\n        protected const string SettingsPath = \"settings.\";\n        protected const string TextureSettingsPath = \"textureImporterSettings.\";\n        protected const string AnimationSettingsPath = \"animationSettings.\";\n        \n        private AseFileImporterEditor baseEditor;\n        \n        protected readonly Dictionary<string, bool> foldoutStates = new Dictionary<string, bool>();\n        private AseFileImporter importer;\n\n        public AseFileImporter Importer => importer;\n        protected AseFileImportType ImportType => baseEditor.ImportType;\n        protected SerializedObject SerializedObject => baseEditor.serializedObject;\n\n        internal void Enable(AseFileImporterEditor importerEditor)\n        {\n            foldoutStates.Clear();\n            baseEditor = importerEditor;\n            \n            OnEnable();\n        }\n\n        internal void Disable()\n        {\n            OnDisable();\n        }\n\n        internal void InspectorGUI()\n        {\n            importer = SerializedObject.targetObject as AseFileImporter;\n            OnInspectorGUI();\n        }\n\n        protected void ApplyAndImport()\n        {\n            baseEditor.CallApplyAndImport();\n        }\n\n        protected virtual void OnEnable()\n        {\n        }\n\n        protected virtual void OnDisable()\n        {\n        }\n        \n        protected virtual void OnInspectorGUI() \n        {\n        }\n        \n        \n        protected bool CustomEnumPopup(string label, SerializedProperty property, Dictionary<int, string> mappings)\n        {\n            if (!mappings.ContainsKey(property.enumValueIndex))\n            {\n                Debug.LogWarning(\"AsepriteImporterEditor: Enum Mapping is missing key\");\n                property.enumValueIndex = 0;\n            }\n\n            string[] names = mappings.Values.ToArray();\n            int[] indices = mappings.Keys.ToArray();\n\n\n            int index = Array.IndexOf(indices, property.enumValueIndex);\n            EditorGUI.BeginChangeCheck();\n            int indexNew = EditorGUILayout.Popup(label, index, names);\n            if (EditorGUI.EndChangeCheck())\n            {\n                property.enumValueIndex = indices[indexNew];\n                return true;\n            }\n\n            return false;\n        }\n    }\n}"
  },
  {
    "path": "Editor/Editors/SpriteImporterEditor.cs.meta",
    "content": "﻿fileFormatVersion: 2\nguid: 2c383fc29abf40158b21ebe81090375c\ntimeCreated: 1609169504"
  },
  {
    "path": "Editor/Editors.meta",
    "content": "﻿fileFormatVersion: 2\nguid: fe1ac2b66b0748cbaf3f445f1dc5aad6\ntimeCreated: 1609169495"
  },
  {
    "path": "Editor/Importers/AnimationImporter.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Text;\nusing Aseprite;\nusing Aseprite.Chunks;\nusing AsepriteImporter.Settings;\nusing UnityEditor;\nusing UnityEngine;\n\nnamespace AsepriteImporter.Importers\n{\n    public class AnimationImporter\n    {\n        private readonly AseFile aseFile;\n\n        public AnimationImporter(AseFile aseFile)\n        {\n            this.aseFile = aseFile;\n        }\n\n        public AseFileAnimationSettings[] GetAnimationImportSettings()\n        {\n            List<AseFileAnimationSettings> animationSettings = new List<AseFileAnimationSettings>();\n\n            FrameTag[] frameTags = aseFile.GetAnimations();\n\n            foreach (var frameTag in frameTags)\n            {\n                int frames = frameTag.FrameTo - frameTag.FrameFrom + 1;\n\n                AseFileAnimationSettings setting = new AseFileAnimationSettings(frameTag.TagName)\n                {\n                    about = GetAnimationAbout(frameTag),\n                    loopTime = true,\n                    sprites = new Sprite[frames],\n                    frameNumbers = new int[frames]\n                };\n\n                int frameFrom = frameTag.FrameFrom;\n                int frameTo = frameTag.FrameTo;\n                int step = (frameTag.Animation != LoopAnimation.Reverse) ? 1 : -1;\n\n                int frameIndex = frameFrom;\n                int i = 0;\n                while (frameIndex != frameTo)\n                {\n                    setting.frameNumbers[i] = frameIndex;\n                    frameIndex += step;\n                    ++i;\n                }\n\n                setting.frameNumbers[i] = frameTo;\n\n                animationSettings.Add(setting);\n            }\n\n            return animationSettings.ToArray();\n        }\n\n        public AnimationClip[] GenerateAnimations(string parentName, AseFileAnimationSettings[] animationSettings)\n        {\n            var animations = aseFile.GetAnimations();\n\n            if (animations.Length <= 0)\n                return new AnimationClip[0];\n\n            AnimationClip[] animationClips = new AnimationClip[animations.Length];\n\n            int index = 0;\n\n            foreach (var animation in animations)\n            {\n                AseFileAnimationSettings importSettings = GetAnimationSettingFor(animationSettings, animation);\n                if (importSettings == null)\n                    continue;\n\n                if (importSettings.HasInvalidSprites)\n                    continue;\n\n                AnimationClip animationClip = new AnimationClip\n                {\n                    name = parentName + \"_\" + animation.TagName,\n                    frameRate = 25\n                };\n\n                EditorCurveBinding spriteBinding = new EditorCurveBinding\n                {\n                    type = typeof(SpriteRenderer),\n                    path = \"\",\n                    propertyName = \"m_Sprite\"\n                };\n\n\n                int length = animation.FrameTo - animation.FrameFrom + 1;\n                ObjectReferenceKeyframe[]\n                    spriteKeyFrames = new ObjectReferenceKeyframe[length + 1]; // plus last frame to keep the duration\n\n                float time = 0;\n\n                int from = (animation.Animation != LoopAnimation.Reverse) ? animation.FrameFrom : animation.FrameTo;\n                int step = (animation.Animation != LoopAnimation.Reverse) ? 1 : -1;\n\n                int keyIndex = from;\n\n                for (int i = 0; i < length; i++)\n                {\n                    if (i >= length)\n                    {\n                        keyIndex = from;\n                    }\n\n                    ObjectReferenceKeyframe frame = new ObjectReferenceKeyframe\n                    {\n                        time = time,\n                        value = importSettings.sprites[i]\n                    };\n\n                    time += aseFile.Frames[keyIndex].FrameDuration / 1000f;\n\n                    keyIndex += step;\n                    spriteKeyFrames[i] = frame;\n                }\n\n                float frameTime = 1f / animationClip.frameRate;\n\n                ObjectReferenceKeyframe lastFrame = new ObjectReferenceKeyframe\n                {\n                    time = time - frameTime,\n                    value = importSettings.sprites[length - 1]\n                };\n\n                spriteKeyFrames[spriteKeyFrames.Length - 1] = lastFrame;\n\n\n                AnimationUtility.SetObjectReferenceCurve(animationClip, spriteBinding, spriteKeyFrames);\n                AnimationClipSettings settings = AnimationUtility.GetAnimationClipSettings(animationClip);\n\n                switch (animation.Animation)\n                {\n                    case LoopAnimation.Forward:\n                        animationClip.wrapMode = WrapMode.Loop;\n                        settings.loopTime = true;\n                        break;\n                    case LoopAnimation.Reverse:\n                        animationClip.wrapMode = WrapMode.Loop;\n                        settings.loopTime = true;\n                        break;\n                    case LoopAnimation.PingPong:\n                        animationClip.wrapMode = WrapMode.PingPong;\n                        settings.loopTime = true;\n                        break;\n                }\n\n                if (!importSettings.loopTime)\n                {\n                    animationClip.wrapMode = WrapMode.Once;\n                    settings.loopTime = false;\n                }\n\n                AnimationUtility.SetAnimationClipSettings(animationClip, settings);\n                animationClips[index] = animationClip;\n\n                index++;\n            }\n\n            return animationClips;\n        }\n\n\n        public AseFileAnimationSettings GetAnimationSettingFor(AseFileAnimationSettings[] animationSettings,\n            FrameTag animation)\n        {\n            for (int i = 0; i < animationSettings.Length; i++)\n            {\n                if (animationSettings[i].animationName == animation.TagName)\n                    return animationSettings[i];\n            }\n\n            return null;\n        }\n\n        public string GetAnimationAbout(FrameTag animation)\n        {\n            StringBuilder sb = new StringBuilder();\n            sb.AppendFormat(\"Animation Type:\\t{0}\", animation.Animation.ToString());\n            sb.AppendLine();\n            sb.AppendFormat(\"Animation:\\tFrom: {0}; To: {1}\", animation.FrameFrom, animation.FrameTo);\n\n            return sb.ToString();\n        }\n    }\n}"
  },
  {
    "path": "Editor/Importers/AnimationImporter.cs.meta",
    "content": "﻿fileFormatVersion: 2\nguid: 8f01fb9a6eba43df8edbbc2e1a4861f2\ntimeCreated: 1609174934"
  },
  {
    "path": "Editor/Importers/BundledSpriteImporter.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing Aseprite;\nusing AsepriteImporter.Data;\nusing AsepriteImporter.DataProviders;\nusing AsepriteImporter.Settings;\nusing UnityEditor;\nusing UnityEditor.U2D.Sprites;\nusing UnityEngine;\n\n#if UNITY_2020_2_OR_NEWER\nusing UnityEditor.AssetImporters;\n#else\nusing UnityEditor.Experimental.AssetImporters;\n#endif\n\n\nnamespace AsepriteImporter.Importers\n{\n    public class BundledSpriteImporter : SpriteImporter\n    {\n        [SerializeField] public Texture2D atlas;\n\n        [SerializeField] private Texture2D thumbnail;\n\n        [SerializeField] private int frameCount;\n        [SerializeField] private int textureWidth;\n        [SerializeField] private int textureHeight;\n\n        [SerializeField] private Sprite[] sprites;\n        \n        public Texture2D Thumbnail => thumbnail;\n        public override Sprite[] Sprites => sprites;\n        \n\n        public override SpriteImportMode spriteImportMode => (SpriteImportMode)TextureImportSettings.spriteMode;\n        public override float pixelsPerUnit => TextureImportSettings.spritePixelsPerUnit;\n        public override UnityEngine.Object targetObject => Importer;\n        \n        private string name;\n\n        public BundledSpriteImporter(AseFileImporter importer) : base(importer)\n        {\n            \n        }\n        \n        public override void OnImport()\n        {\n            name = GetFileName(AssetPath);\n            sprites = new Sprite[0];\n            \n            GenerateAtlasTexture();\n            \n            if (SpriteImportData == null || SpriteImportData.Length == 0 || TextureImportSettings.spriteMode == (int)SpriteImportMode.Single)\n            {\n                SetSingleSpriteImportData();\n            }\n            \n            ProcessAnimationSettings();\n\n            GenerateTexture(AssetPath);\n\n            ApplySpritesToAnimation();\n\n            Context.AddObjectToAsset(\"Texture\", Texture);\n            Context.SetMainObject(Texture);\n\n            foreach (Sprite sprite in sprites)\n            {\n                Context.AddObjectToAsset(sprite.name, sprite);\n            }\n\n\n            if (Settings.generateAnimations)\n            {\n                AnimationImporter animationImporter = new AnimationImporter(AsepriteFile);\n                AnimationClip[] animations = animationImporter.GenerateAnimations(name, AnimationSettings);\n\n                foreach (AnimationClip clip in animations)\n                {\n                    //AssetDatabase.CreateAsset(clip, GetPath(assetPath) + clip.name + \".asset\");\n                    if (clip == null)\n                        continue;\n\n                    Context.AddObjectToAsset(clip.name, clip);\n                }\n            }\n        }\n        \n        public void SetSingleSpriteImportData()\n        {\n            Rect spriteRect = new Rect(0, atlas.height - AsepriteFile.Header.Height, AsepriteFile.Header.Width, AsepriteFile.Header.Height);\n            SpriteImportData = new AseFileSpriteImportData[]\n            {\n                    new AseFileSpriteImportData()\n                    {\n                        alignment = SpriteAlignment.Center,\n                        border = Vector4.zero,\n                        name = name,\n                        outline = SpriteAtlasBuilder.GenerateRectOutline(spriteRect),\n                        pivot = new Vector2(0.5f, 0.5f),\n                        rect = spriteRect,\n                        spriteID = GUID.Generate().ToString(),\n                        tessellationDetail = 0\n                    }\n            };\n\n            AnimationSettings = null;\n        }\n\n        public AseFileSpriteImportData[] GetSingleSpriteImportData()\n        {\n            Rect spriteRect = new Rect(0, 0, textureWidth, textureHeight);\n            return new AseFileSpriteImportData[]\n            {\n                    new AseFileSpriteImportData()\n                    {\n                        alignment = SpriteAlignment.Center,\n                        border = Vector4.zero,\n                        name = name,\n                        outline = SpriteAtlasBuilder.GenerateRectOutline(spriteRect),\n                        pivot = new Vector2(0.5f, 0.5f),\n                        rect = spriteRect,\n                        spriteID = GUID.Generate().ToString(),\n                        tessellationDetail = 0\n                    }\n            };\n        }\n\n        private void GenerateTexture(string assetPath)\n        {\n            SourceTextureInformation textureInformation = new SourceTextureInformation()\n            {\n                containsAlpha = true,\n                hdr = false,\n                height = textureHeight,\n                width = textureWidth\n            };\n\n            TextureImporterPlatformSettings platformSettings = new TextureImporterPlatformSettings()\n            {\n                overridden = false\n            };\n\n            TextureGenerationSettings settings = new TextureGenerationSettings()\n            {\n                assetPath = assetPath,\n                spriteImportData = ConvertAseFileSpriteImportDataToUnity(SpriteImportData),\n                textureImporterSettings = TextureImportSettings.ToImporterSettings(),\n                enablePostProcessor = false,\n                sourceTextureInformation = textureInformation,\n                qualifyForSpritePacking = true,\n                platformSettings = platformSettings,\n                spritePackingTag = \"aseprite\",\n                secondarySpriteTextures = new SecondarySpriteTexture[0]\n            };\n\n\n            TextureGenerationOutput output = TextureGenerator.GenerateTexture(settings, new Unity.Collections.NativeArray<Color32>(atlas.GetPixels32(), Unity.Collections.Allocator.Temp));\n\n            Texture = output.texture;\n            thumbnail = output.thumbNail;\n            sprites = output.sprites;\n        }\n\n        public void GenerateAtlasTexture(bool overwriteSprites = false)\n        {\n            if (atlas != null)\n                return;\n\n            SpriteAtlasBuilder atlasBuilder = new SpriteAtlasBuilder(AsepriteFile.Header.Width, AsepriteFile.Header.Height);\n\n            Texture2D[] frames = AsepriteFile.GetFrames();\n\n            atlas = atlasBuilder.GenerateAtlas(frames, out var importData, false);\n\n            textureWidth = atlas.width;\n            textureHeight = atlas.height;\n            frameCount = importData.Length;\n\n            // Rename sprites\n\n            if (overwriteSprites)\n            {\n                for (int i = 0; i < importData.Length; i++)\n                {\n                    importData[i].name = string.Format(\"{0}_{1}\", name, importData[i].name);\n                }\n\n                SpriteRects = new SpriteRect[0];\n                SpriteImportData = importData;\n\n                if (SpriteImportData.Length > 1)\n                    TextureImportSettings.spriteMode = (int)SpriteImportMode.Multiple;\n\n\n                AssetDatabase.WriteImportSettingsIfDirty(AssetPath);\n            }\n        }\n\n        private void ProcessAnimationSettings()\n        {\n            AnimationImporter animationImporter = new AnimationImporter(AsepriteFile);\n\n            if (AnimationSettings == null || AnimationSettings.Length == 0)\n            {\n                AnimationSettings = animationImporter.GetAnimationImportSettings();\n            }\n            else\n            {\n                AseFileAnimationSettings[] settings = animationImporter.GetAnimationImportSettings();\n\n                List<AseFileAnimationSettings> newSettings = new List<AseFileAnimationSettings>();\n                foreach (var setting in settings)\n                {\n                    var currentSetting = Array.Find(AnimationSettings, s => s.animationName == setting.animationName);\n\n                    if (currentSetting != null)\n                    {\n                        // Settings already exist\n                        newSettings.Add(currentSetting);\n                    }\n                    else\n                    {\n                        // New Settings\n                        newSettings.Add(setting);\n                    }\n                }\n\n                AnimationSettings = newSettings.ToArray();\n            }\n        }\n\n        private void ApplySpritesToAnimation()\n        {\n            if (sprites.Length != frameCount)\n                return;\n\n\n            for (int i = 0; i < AnimationSettings.Length; i++)\n            {\n                var settings = AnimationSettings[i];\n\n                for (int n = 0; n < settings.sprites.Length; n++)\n                {\n                    if (settings.sprites[n] == null)\n                        settings.sprites[n] = sprites[settings.frameNumbers[n]];\n                }\n\n            }\n            /*\n            for (int i = 0; i < animationSettings.Length; i++)\n            {\n                var settings = animationSettings[i];\n\n                Dictionary<int, Sprite> animationSprites = new Dictionary<int, Sprite>();\n\n                for (int n = 0; n < settings.sprites.Length; n++)\n                {\n                    if (settings.sprites[n] != null)\n                        animationSprites.Add(settings.frameNumbers[n], settings.sprites[n]);\n                }\n\n            }\n            */\n        }\n\n\n\n        private string GetFileName(string assetPath)\n        {\n            string[] parts = assetPath.Split('/');\n            string filename = parts[parts.Length - 1];\n\n            return filename.Substring(0, filename.LastIndexOf('.'));\n        }\n\n        private string GetPath(string assetPath)\n        {\n            string[] parts = assetPath.Split('/');\n            string filename = parts[parts.Length - 1];\n\n            return assetPath.Replace(filename, \"\");\n        }\n\n        private static AseFile ReadAseFile(string assetPath)\n        {\n            FileStream fileStream = new FileStream(assetPath, FileMode.Open, FileAccess.Read);\n            AseFile aseFile = new AseFile(fileStream);\n            fileStream.Close();\n\n            return aseFile;\n        }\n\n\n\n\n        public override void Apply()\n        {\n            if (SpriteRects != null && SpriteRects.Length > 0)\n            {\n                List<AseFileSpriteImportData> newImportData = new List<AseFileSpriteImportData>();\n\n                foreach (SpriteRect spriteRect in SpriteRects)\n                {\n                    AseFileSpriteImportData data = new AseFileSpriteImportData()\n                    {\n                        alignment = spriteRect.alignment,\n                        border = spriteRect.border,\n                        name = spriteRect.name,\n                        pivot = spriteRect.pivot,\n                        rect = spriteRect.rect,\n                        spriteID = spriteRect.spriteID.ToString()\n                    };\n\n                    AseFileSpriteImportData current = Array.Find<AseFileSpriteImportData>(SpriteImportData, d => d.spriteID == spriteRect.spriteID.ToString());\n\n                    if (current != null)\n                    {\n                        data.outline = current.outline;\n                        data.tessellationDetail = current.tessellationDetail;\n                    }\n                    else\n                    {\n                        data.outline = SpriteAtlasBuilder.GenerateRectOutline(data.rect);\n                        data.tessellationDetail = 0;\n                    }\n\n                    newImportData.Add(data);\n                }\n\n                SpriteRects = new SpriteRect[0];\n\n                SpriteImportData = newImportData.ToArray();\n                EditorUtility.SetDirty(Importer);\n            }\n\n            AssetDatabase.WriteImportSettingsIfDirty(AssetPath);\n            //SaveAndReimport();\n\n            AssetDatabase.Refresh();\n            AssetDatabase.LoadAllAssetsAtPath(AssetPath);\n            EditorApplication.RepaintProjectWindow();\n        }\n\n        private static SpriteImportData[] ConvertAseFileSpriteImportDataToUnity(AseFileSpriteImportData[] spriteImportData)\n        {\n            SpriteImportData[] importData = new SpriteImportData[spriteImportData.Length];\n\n            for (int i = 0; i < spriteImportData.Length; i++)\n            {\n                importData[i] = spriteImportData[i].ToSpriteImportData();\n            }\n\n            return importData;\n        }\n    }\n}"
  },
  {
    "path": "Editor/Importers/BundledSpriteImporter.cs.meta",
    "content": "﻿fileFormatVersion: 2\nguid: 2cd8aaeca28c4f97bab4f65cc47713c0\ntimeCreated: 1609172958"
  },
  {
    "path": "Editor/Importers/GeneratedSpriteImporter.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing Aseprite;\nusing Aseprite.Chunks;\nusing Aseprite.Utils;\nusing UnityEditor;\nusing UnityEditor.Animations;\nusing UnityEditor.U2D;\nusing UnityEngine;\nusing UnityEngine.U2D;\nusing UnityEngine.UI;\n\nnamespace AsepriteImporter.Importers {\n    public class GeneratedSpriteImporter : SpriteImporter {\n        private int padding = 1;\n        private Vector2Int size;\n        private string fileName;\n        private string directoryName;\n        private string filePath;\n        private int updateLimit;\n        private int rows;\n        private int cols;\n        private Texture2D []frames;\n\n\n        public GeneratedSpriteImporter(AseFileImporter importer) : base(importer)\n        {\n        }\n\n        public override void OnImport()\n        {\n            size = new Vector2Int(AsepriteFile.Header.Width, AsepriteFile.Header.Height);\n\n            frames = AsepriteFile.GetFrames();\n            BuildAtlas(AssetPath);\n        }\n\n        protected override bool OnUpdate() {\n            if (GenerateSprites()) {\n                GeneratorAnimations();\n                return true;\n            }\n\n            return false;\n        }\n\n        private void BuildAtlas(string acePath) {\n            fileName = Path.GetFileNameWithoutExtension(acePath);\n            directoryName = Path.GetDirectoryName(acePath) + \"/\" + fileName;\n            if (!AssetDatabase.IsValidFolder(directoryName)) {\n                AssetDatabase.CreateFolder(Path.GetDirectoryName(acePath), fileName);\n            }\n\n            filePath = directoryName + \"/\" + fileName + \".png\";\n\n            var atlas = GenerateAtlas(frames);\n            try {\n                File.WriteAllBytes(filePath, atlas.EncodeToPNG());\n                AssetDatabase.SaveAssets();\n                AssetDatabase.Refresh();\n            } catch (Exception e) {\n                Debug.LogError(e.Message);\n            }\n        }\n\n        public Texture2D GenerateAtlas(Texture2D []sprites) {\n            var area = size.x * size.y * sprites.Length;\n            if (sprites.Length < 4) {\n                if (size.x <= size.y) {\n                    cols = sprites.Length;\n                    rows = 1;\n                } else {\n                    rows = sprites.Length;\n                    cols = 1;\n                }\n            } else {\n                var sqrt = Mathf.Sqrt(area);\n                cols = Mathf.CeilToInt(sqrt / size.x);\n                rows = Mathf.CeilToInt(sqrt / size.y);\n            }\n\n            var width = cols * (size.x + padding * 2);\n            var height = rows * (size.y + padding * 2);\n            var atlas = Texture2DUtil.CreateTransparentTexture(width, height);\n\n            var index = 0;\n            for (var row = 0; row < rows; row++) {\n                for (var col = 0; col < cols; col++) {\n                    if (index == sprites.Length) {\n                        break;\n                    }\n\n                    var sprite = sprites[index];\n                    var rect = new RectInt(col * (size.x + padding * 2) + padding,\n                                           height - (row + 1) * (size.y + padding * 2) + padding,\n                                           size.x,\n                                           size.y);\n                    CopyColors(sprite, atlas, rect);\n                    index++;\n                }\n            }\n\n            return atlas;\n        }\n\n        private Color[] GetPixels(Texture2D sprite) {\n            var res = sprite.GetPixels();\n            if (Settings.transparencyMode == TransparencyMode.Mask) {\n                for (int index = 0; index < res.Length; index++) {\n                    var color = res[index];\n                    if (color == Settings.transparentColor) {\n                        color.r = color.g = color.b = color.a = 0;\n                        res[index] = color;\n                    }\n                }\n            }\n            return res;\n        }\n\n        private void CopyColors(Texture2D sprite, Texture2D atlas, RectInt to ) {\n            atlas.SetPixels(to.x, to.y, to.width, to.height, GetPixels(sprite));\n        }\n\n        private bool GenerateSprites() {\n            TextureImporter importer = AssetImporter.GetAtPath(filePath) as TextureImporter;\n            if (importer == null) {\n                return false;\n            }\n\n            importer.textureType = TextureImporterType.Sprite;\n            importer.spritePixelsPerUnit = Settings.pixelsPerUnit;\n            importer.mipmapEnabled = false;\n            importer.filterMode = FilterMode.Point;\n\n            var metaList = CreateMetaData(fileName);\n            var oldProperties = AseSpritePostProcess.GetPhysicsShapeProperties(importer, metaList);\n\n            importer.spritesheet = metaList.ToArray();\n            importer.textureCompression = TextureImporterCompression.Uncompressed;\n            importer.spriteImportMode = SpriteImportMode.Multiple;\n\n            EditorUtility.SetDirty(importer);\n            try {\n                importer.SaveAndReimport();\n            } catch (Exception e) {\n                Debug.LogWarning(\"There was a problem with generating sprite file: \" + e);\n            }\n\n            var newProperties = AseSpritePostProcess.GetPhysicsShapeProperties(importer, metaList);\n\n            AseSpritePostProcess.RecoverPhysicsShapeProperty(newProperties, oldProperties);\n            AssetDatabase.Refresh();\n            AssetDatabase.SaveAssets();\n            return true;\n        }\n\n        private List<SpriteMetaData> CreateMetaData(string fileName) {\n            var res = new List<SpriteMetaData>();\n            var index = 0;\n            var height = rows * (size.y + padding * 2);\n            var done = false;\n            var count10 = frames.Length >= 100 ? 3 : (frames.Length >= 10 ? 2 : 1);\n\n            for (var row = 0; row < rows; row++) {\n                for (var col = 0; col < cols; col++) {\n                    Rect rect = new Rect(col * (size.x + padding * 2) + padding,\n                                         height - (row + 1) * (size.y + padding * 2) + padding,\n                                         size.x,\n                                         size.y);\n                    var meta = new SpriteMetaData();\n                    meta.name = fileName + index.ToString(\"D\" + count10);\n                    meta.rect = rect;\n                    meta.alignment = Settings.spriteAlignment;\n                    meta.pivot = Settings.spritePivot;\n                    res.Add(meta);\n                    index++;\n\n                    if (index >= frames.Length) {\n                        done = true;\n                        break;\n                    }\n                }\n\n                if (done) {\n                    break;\n                }\n            }\n\n            return res;\n        }\n\n        private void GeneratorAnimations() {\n            var sprites = GetAllSpritesFromAssetFile(filePath);\n            sprites.Sort((lhs, rhs) => String.CompareOrdinal(lhs.name, rhs.name));\n\n            var clips = GenerateAnimations(AsepriteFile, sprites);\n            if (Settings.buildAtlas) {\n                CreateSpriteAtlas(sprites);\n            }\n\n            if (Settings.animType == AseAnimatorType.AnimatorController) {\n                CreateAnimatorController(clips);\n            } else if (Settings.animType == AseAnimatorType.AnimatorOverrideController) {\n                CreateAnimatorOverrideController(clips);\n            }\n        }\n\n        private WrapMode GetDefaultWrapMode(string animName) {\n            animName = animName.ToLower();\n            if (animName.IndexOf(\"walk\", StringComparison.Ordinal) >= 0 ||\n                animName.IndexOf(\"run\", StringComparison.Ordinal) >= 0 ||\n                animName.IndexOf(\"idle\", StringComparison.Ordinal) >= 0) {\n                return WrapMode.Loop;\n            }\n\n            return WrapMode.Once;\n        }\n\n        private List<AnimationClip> GenerateAnimations(AseFile aseFile, List<Sprite> sprites) {\n            List<AnimationClip> res = new List<AnimationClip>();\n            var animations = aseFile.GetAnimations();\n            if (animations.Length <= 0) {\n                return res;\n            }\n\n            var metadatas = aseFile.GetMetaData(Settings.spritePivot, Settings.pixelsPerUnit);\n\n            int index = 0;\n            foreach (var animation in animations) {\n                var path = directoryName + \"/\" + fileName + \"_\" + animation.TagName + \".anim\";\n                AnimationClip clip = AssetDatabase.LoadAssetAtPath<AnimationClip>(path);\n                if (clip == null) {\n                    clip = new AnimationClip();\n                    AssetDatabase.CreateAsset(clip, path);\n                    clip.wrapMode = GetDefaultWrapMode(animation.TagName);\n                } else {\n                    AnimationClipSettings animSettings = AnimationUtility.GetAnimationClipSettings(clip);\n                    clip.wrapMode = animSettings.loopTime ? WrapMode.Loop : WrapMode.Once;\n                }\n\n                clip.name = fileName + \"_\" + animation.TagName;\n                clip.frameRate = 25;\n\n                EditorCurveBinding editorBinding = new EditorCurveBinding();\n                editorBinding.path = \"\";\n                editorBinding.propertyName = \"m_Sprite\";\n\n                switch (Settings.bindType) {\n                    case AseAnimationBindType.SpriteRenderer:\n                        editorBinding.type = typeof(SpriteRenderer);\n                        break;\n                    case AseAnimationBindType.UIImage:\n                        editorBinding.type = typeof(Image);\n                        break;\n                }\n\n                // plus last frame to keep the duration\n                int length = animation.FrameTo - animation.FrameFrom + 1;\n                ObjectReferenceKeyframe[] spriteKeyFrames = new ObjectReferenceKeyframe[length + 1];\n                Dictionary<string, AnimationCurve> transformCurveX = new Dictionary<string, AnimationCurve>(),\n                                                   transformCurveY = new Dictionary<string, AnimationCurve>();\n\n                float time = 0;\n                int from = (animation.Animation != LoopAnimation.Reverse) ? animation.FrameFrom : animation.FrameTo;\n                int step = (animation.Animation != LoopAnimation.Reverse) ? 1 : -1;\n\n                int keyIndex = from;\n                for (int i = 0; i < length; i++) {\n                    if (i >= length) {\n                        keyIndex = from;\n                    }\n\n                    ObjectReferenceKeyframe frame = new ObjectReferenceKeyframe();\n                    frame.time = time;\n                    frame.value = sprites[keyIndex];\n\n                    time += aseFile.Frames[keyIndex].FrameDuration / 1000f;\n                    spriteKeyFrames[i] = frame;\n\n                    foreach (var metadata in metadatas) {\n                        if (metadata.Type == MetaDataType.TRANSFORM && metadata.Transforms.ContainsKey(keyIndex)) {\n                            var childTransform = metadata.Args[0];\n                            if (!transformCurveX.ContainsKey(childTransform)) {\n                                transformCurveX[childTransform] = new AnimationCurve();\n                                transformCurveY[childTransform] = new AnimationCurve();\n                            }\n                            var pos = metadata.Transforms[keyIndex];\n                            transformCurveX[childTransform].AddKey(i, pos.x);\n                            transformCurveY[childTransform].AddKey(i, pos.y);\n                        }\n                    }\n\n                    keyIndex += step;\n                }\n\n                float frameTime = 1f / clip.frameRate;\n                ObjectReferenceKeyframe lastFrame = new ObjectReferenceKeyframe();\n                lastFrame.time = time - frameTime;\n                lastFrame.value = sprites[keyIndex - step];\n\n                spriteKeyFrames[spriteKeyFrames.Length - 1] = lastFrame;\n                foreach (var metadata in metadatas) {\n                    if (metadata.Type == MetaDataType.TRANSFORM && metadata.Transforms.ContainsKey(keyIndex - step)) {\n                        var childTransform = metadata.Args[0];\n                        var pos = metadata.Transforms[keyIndex - step];\n                        transformCurveX[childTransform].AddKey(spriteKeyFrames.Length - 1, pos.x);\n                        transformCurveY[childTransform].AddKey(spriteKeyFrames.Length - 1, pos.y);\n                    }\n                }\n\n                AnimationUtility.SetObjectReferenceCurve(clip, editorBinding, spriteKeyFrames);\n                foreach (var childTransform in transformCurveX.Keys) {\n                    EditorCurveBinding\n                    bindingX = new EditorCurveBinding {\n                        path = childTransform,\n                        type = typeof(Transform),\n                        propertyName = \"m_LocalPosition.x\"\n                    },\n                    bindingY = new EditorCurveBinding {\n                        path = childTransform,\n                        type = typeof(Transform),\n                        propertyName = \"m_LocalPosition.y\"\n                    };\n                    MakeConstant(transformCurveX[childTransform]);\n                    AnimationUtility.SetEditorCurve(clip, bindingX, transformCurveX[childTransform]);\n                    MakeConstant(transformCurveY[childTransform]);\n                    AnimationUtility.SetEditorCurve(clip, bindingY, transformCurveY[childTransform]);\n                }\n\n                AnimationClipSettings clipSettings = AnimationUtility.GetAnimationClipSettings(clip);\n                clipSettings.loopTime = (clip.wrapMode == WrapMode.Loop);\n\n                AnimationUtility.SetAnimationClipSettings(clip, clipSettings);\n                EditorUtility.SetDirty(clip);\n                index++;\n                res.Add(clip);\n            }\n\n            return res;\n        }\n\n        private static void MakeConstant(AnimationCurve curve) {\n            for (int i = 0; i < curve.length; ++i) {\n                AnimationUtility.SetKeyRightTangentMode(curve, i, AnimationUtility.TangentMode.Constant);\n            }\n        }\n\n        private static List<Sprite> GetAllSpritesFromAssetFile(string imageFilename) {\n            var assets = AssetDatabase.LoadAllAssetsAtPath(imageFilename);\n\n            // make sure we only grab valid sprites here\n            List<Sprite> sprites = new List<Sprite>();\n            foreach (var item in assets) {\n                if (item is Sprite) {\n                    sprites.Add(item as Sprite);\n                }\n            }\n\n            return sprites;\n        }\n\n        private void CreateAnimatorController(List<AnimationClip> animations) {\n            var path = directoryName + \"/\" + fileName + \".controller\";\n            AnimatorController controller = AssetDatabase.LoadAssetAtPath<AnimatorController>(path);\n\n            if (controller == null) {\n                controller = AnimatorController.CreateAnimatorControllerAtPath(path);\n                controller.AddLayer(\"Default\");\n\n                foreach (var animation in animations) {\n                    var stateName = animation.name;\n                    stateName = stateName.Replace(fileName + \"_\", \"\");\n\n                    AnimatorState state = controller.layers[0].stateMachine.AddState(stateName);\n                    state.motion = animation;\n                }\n            } else {\n                var clips = new Dictionary<string, AnimationClip>();\n                foreach (var anim in animations) {\n                    var stateName = anim.name;\n                    stateName = stateName.Replace(fileName + \"_\", \"\");\n                    clips[stateName] = anim;\n                }\n\n                var childStates = controller.layers[0].stateMachine.states;\n                foreach (var childState in childStates) {\n                    if (clips.TryGetValue(childState.state.name, out AnimationClip clip)) {\n                        childState.state.motion = clip;\n                    }\n                }\n            }\n\n            EditorUtility.SetDirty(controller);\n            AssetDatabase.SaveAssets();\n        }\n\n        private void CreateAnimatorOverrideController(List<AnimationClip> animations) {\n            var path = directoryName + \"/\" + fileName + \".overrideController\";\n            var controller = AssetDatabase.LoadAssetAtPath<AnimatorOverrideController>(path);\n            var baseController = controller?.runtimeAnimatorController;\n            if (controller == null) {\n                controller = new AnimatorOverrideController();\n                AssetDatabase.CreateAsset(controller, path);\n                baseController = Settings.baseAnimator;\n            }\n\n            if (baseController == null) {\n                Debug.LogError(\"Can not make override controller\");\n                return;\n            }\n\n            controller.runtimeAnimatorController = baseController;\n            var clips = new Dictionary<string, AnimationClip>();\n            foreach (var anim in animations) {\n                var stateName = anim.name;\n                stateName = stateName.Replace(fileName + \"_\", \"\");\n                clips[stateName] = anim;\n            }\n\n            var clipPairs = new List<KeyValuePair<AnimationClip, AnimationClip>>(controller.overridesCount);\n            controller.GetOverrides(clipPairs);\n\n            foreach (var pair in clipPairs) {\n                string animationName = pair.Key.name;\n                if (clips.TryGetValue(animationName, out AnimationClip clip)) {\n                    controller[animationName] = clip;\n                }\n            }\n\n            EditorUtility.SetDirty(controller);\n            AssetDatabase.SaveAssets();\n        }\n\n        private void CreateSpriteAtlas(List<Sprite> sprites) {\n            var path = directoryName + \"/\" + fileName + \".spriteatlas\";\n            var atlas = AssetDatabase.LoadAssetAtPath<SpriteAtlas>(path);\n            if (atlas == null) {\n                atlas = new SpriteAtlas();\n                AssetDatabase.CreateAsset(atlas, path);\n            }\n\n            var texSetting = new SpriteAtlasTextureSettings();\n            texSetting.filterMode = FilterMode.Point;\n            texSetting.generateMipMaps = false;\n\n            var packSetting = new SpriteAtlasPackingSettings();\n            packSetting.padding = 2;\n            packSetting.enableRotation = false;\n            packSetting.enableTightPacking = true;\n\n            var platformSetting = new TextureImporterPlatformSettings();\n            platformSetting.textureCompression = TextureImporterCompression.Uncompressed;\n\n            atlas.SetTextureSettings(texSetting);\n            atlas.SetPackingSettings(packSetting);\n            atlas.SetPlatformSettings(platformSetting);\n            atlas.Add(sprites.ToArray());\n\n            EditorUtility.SetDirty(atlas);\n            AssetDatabase.SaveAssets();\n        }\n\n\n    }\n}"
  },
  {
    "path": "Editor/Importers/GeneratedSpriteImporter.cs.meta",
    "content": "fileFormatVersion: 2\nguid: 9cbe0b18f44e74532878ce1d492f9efb\nMonoImporter:\n  externalObjects: {}\n  serializedVersion: 2\n  defaultReferences: []\n  executionOrder: 0\n  icon: {instanceID: 0}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "Editor/Importers/GeneratedTileImporter.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing Aseprite;\nusing Aseprite.Utils;\nusing UnityEditor;\nusing UnityEngine;\n\nnamespace AsepriteImporter {\n    public class GeneratedTileImporter : SpriteImporter {\n        private int padding = 1;\n        private Vector2Int size;\n        private string fileName;\n        private string filePath;\n        private int updateLimit;\n        private Texture2D atlas;\n\n        public GeneratedTileImporter(AseFileImporter importer) : base(importer)\n        {\n        }\n\n        public override void OnImport()\n        {\n            size = new Vector2Int(AsepriteFile.Header.Width, AsepriteFile.Header.Height);\n\n            Texture2D frame = AsepriteFile.GetFrames()[0];\n            BuildAtlas(AssetPath, frame);\n        }\n\n        protected override bool OnUpdate()\n        {\n            return GenerateSprites(filePath, size);\n        }\n\n        private void BuildAtlas(string acePath, Texture2D sprite) {\n            fileName= Path.GetFileNameWithoutExtension(acePath);\n            var directoryName = Path.GetDirectoryName(acePath) + \"/\" + fileName;\n            if (!AssetDatabase.IsValidFolder(directoryName)) {\n                AssetDatabase.CreateFolder(Path.GetDirectoryName(acePath), fileName);\n            }\n\n            filePath = directoryName + \"/\" + fileName + \".png\";\n\n            GenerateAtlas(sprite);\n            try {\n                File.WriteAllBytes(filePath, atlas.EncodeToPNG());\n                AssetDatabase.SaveAssets();\n                AssetDatabase.Refresh();\n            } catch (Exception e) {\n                Debug.LogError(e.Message);\n            }\n        }\n\n        private void GenerateAtlas(Texture2D sprite) {\n            var spriteSizeW = Settings.tileSize.x + padding * 2;\n            var spriteSizeH = Settings.tileSize.y + padding * 2;\n            var cols = sprite.width / Settings.tileSize.x;\n            var rows = sprite.height / Settings.tileSize.y;\n            var width = cols * spriteSizeW;\n            var height = rows * spriteSizeH;\n\n            atlas = Texture2DUtil.CreateTransparentTexture(width, height);\n            for (var row = 0; row < rows; row++) {\n                for (var col = 0; col < cols; col++) {\n                    RectInt from = new RectInt(col * Settings.tileSize.x,\n                                               row * Settings.tileSize.y,\n                                               Settings.tileSize.x,\n                                               Settings.tileSize.y);\n                    RectInt to = new RectInt(col * spriteSizeW + padding,\n                                                 row * spriteSizeH + padding,\n                                                 Settings.tileSize.x,\n                                                 Settings.tileSize.y);\n                    CopyColors(sprite, atlas, from, to);\n                    atlas.Apply();\n                }\n            }\n        }\n\n        private Color[] GetPixels(Texture2D sprite, RectInt from) {\n            var res = sprite.GetPixels(from.x, from.y, from.width, from.height);\n            if (Settings.transparencyMode == TransparencyMode.Mask) {\n                for (int index = 0; index < res.Length; index++) {\n                    var color = res[index];\n                    if (color == Settings.transparentColor) {\n                        color.r = color.g = color.b = color.a = 0;\n                        res[index] = color;\n                    }\n                }\n            }\n\n            return res;\n        }\n\n        private Color GetPixel(Texture2D sprite, int x, int y) {\n            var color = sprite.GetPixel(x, y);\n            if (Settings.transparencyMode == TransparencyMode.Mask) {\n                if (color == Settings.transparentColor) {\n                    color.r = color.g = color.b = color.a = 0;\n                }\n            }\n\n            return color;\n        }\n\n        private void CopyColors(Texture2D sprite, Texture2D atlas, RectInt from, RectInt to) {\n            atlas.SetPixels(to.x, to.y, to.width, to.height, GetPixels(sprite, from));\n\n            for (int index = 0; index < padding; index++) {\n                RectInt lf = new RectInt(from.x, from.y, 1, from.height);\n                RectInt lt = new RectInt(to.x - index - 1, to.y, 1, to.height);\n                RectInt rf = new RectInt(from.xMax - 1, from.y, 1, from.height);\n                RectInt rt = new RectInt(to.xMax + index, to.y, 1, to.height);\n                atlas.SetPixels(lt.x, lt.y, lt.width, lt.height, GetPixels(sprite, lf));\n                atlas.SetPixels(rt.x, rt.y, rt.width, rt.height, GetPixels(sprite, rf));\n            }\n\n            for (int index = 0; index < padding; index++) {\n                RectInt tf = new RectInt(from.x, from.y, from.width, 1);\n                RectInt tt = new RectInt(to.x, to.y - index - 1, to.width, 1);\n                RectInt bf = new RectInt(from.x, from.yMax - 1, from.width, 1);\n                RectInt bt = new RectInt(to.x, to.yMax + index, to.width, 1);\n                atlas.SetPixels(tt.x, tt.y, tt.width, tt.height, GetPixels(sprite, tf));\n                atlas.SetPixels(bt.x, bt.y, bt.width, bt.height, GetPixels(sprite, bf));\n            }\n\n            for (int x = 0; x < padding; x++) {\n                for (int y = 0; y < padding; y++) {\n                    atlas.SetPixel(to.x - x - 1, to.y - y - 1, GetPixel(sprite, from.x, from.y));\n                    atlas.SetPixel(to.xMax + x, to.y - y - 1, GetPixel(sprite, from.xMax - 1, from.y));\n                    atlas.SetPixel(to.x - x - 1, to.yMax + y, GetPixel(sprite, from.x, from.yMax - 1));\n                    atlas.SetPixel(to.xMax + x, to.yMax + y, GetPixel(sprite, from.xMax - 1, from.yMax - 1));\n                }\n            }\n        }\n\n        private bool GenerateSprites(string path, Vector2Int size) {\n            this.size = size;\n\n            var fileName = Path.GetFileNameWithoutExtension(path);\n            TextureImporter importer = AssetImporter.GetAtPath(path) as TextureImporter;\n            if (importer == null) {\n                return false;\n            }\n\n            //TextureImporterSettings textSetting = new TextureImporterSettings();\n            //importer.ReadTextureSettings(textSetting);\n            importer.textureType = TextureImporterType.Sprite;\n            importer.spritePixelsPerUnit = Settings.pixelsPerUnit;\n            importer.mipmapEnabled = false;\n            importer.filterMode = FilterMode.Point;\n            var metaList = CreateMetaData(fileName);\n            var oldProperties = AseSpritePostProcess.GetPhysicsShapeProperties(importer, metaList);\n\n            importer.spritesheet = metaList.ToArray();\n            importer.textureCompression = TextureImporterCompression.Uncompressed;\n            importer.spriteImportMode = SpriteImportMode.Multiple;\n\n            EditorUtility.SetDirty(importer);\n            try {\n                //textSetting.spriteMeshType = SpriteMeshType.FullRect;\n                //importer.SetTextureSettings(textSetting);\n\n                importer.SaveAndReimport();\n            } catch (Exception e) {\n                Debug.LogWarning(\"There was a problem with generating sprite file: \" + e);\n            }\n\n            var newProperties = AseSpritePostProcess.GetPhysicsShapeProperties(importer, metaList);\n\n            AseSpritePostProcess.RecoverPhysicsShapeProperty(newProperties, oldProperties);\n            AssetDatabase.Refresh();\n            AssetDatabase.SaveAssets();\n            return true;\n        }\n\n        private List<SpriteMetaData> CreateMetaData(string fileName) {\n            var tileSize = Settings.tileSize;\n            var cols = size.x / tileSize.x;\n            var rows = size.y / tileSize.y;\n            var res = new List<SpriteMetaData>();\n            var index = 0;\n            var height = rows * (tileSize.y + padding * 2);\n\n            for (var row = 0; row < rows; row++) {\n                for (var col = 0; col < cols; col++) {\n                    Rect rect = new Rect(col * (tileSize.x + padding * 2) + padding,\n                                         height - (row + 1) * (tileSize.y + padding * 2) + padding,\n                                         tileSize.x,\n                                         tileSize.y);\n                    var meta = new SpriteMetaData();\n                    if (Settings.tileEmpty == EmptyTileBehaviour.Remove && IsTileEmpty(rect, atlas)) {\n                        index++;\n                        continue;\n                    }\n\n                    meta.name = fileName + \"_\" + index;\n                    if (Settings.tileNameType == TileNameType.RowCol) {\n                        meta.name = GetRowColTileSpriteName(fileName, col, row, cols, rows);\n                    }\n\n                    meta.rect = rect;\n                    meta.alignment = Settings.spriteAlignment;\n                    meta.pivot = Settings.spritePivot;\n                    res.Add(meta);\n\n                    index++;\n                }\n            }\n\n            return res;\n        }\n\n        private string GetRowColTileSpriteName(string fileName, int x, int y, int cols, int rows) {\n            int yHat = y;\n            string row = yHat.ToString();\n            string col = x.ToString();\n            if (rows > 100) {\n                row = yHat.ToString(\"D3\");\n            } else if (rows > 10) {\n                row = yHat.ToString(\"D2\");\n            }\n\n            if (cols > 100) {\n                col = x.ToString(\"D3\");\n            } else if (cols > 10) {\n                col = x.ToString(\"D2\");\n            }\n\n            return string.Format(\"{0}_{1}_{2}\", fileName, row, col);\n        }\n\n        private SerializedProperty GetPhysicsShapeProperty(TextureImporter importer, string spriteName) {\n            SerializedObject serializedImporter = new SerializedObject(importer);\n\n            if (importer.spriteImportMode == SpriteImportMode.Multiple) {\n                var spriteSheetSP = serializedImporter.FindProperty(\"m_SpriteSheet.m_Sprites\");\n\n                for (int i = 0; i < spriteSheetSP.arraySize; i++) {\n                    if (importer.spritesheet[i].name == spriteName) {\n                        var element = spriteSheetSP.GetArrayElementAtIndex(i);\n                        return element.FindPropertyRelative(\"m_PhysicsShape\");\n                    }\n                }\n\n            }\n\n            return serializedImporter.FindProperty(\"m_SpriteSheet.m_PhysicsShape\");\n        }\n\n        private bool IsTileEmpty(Rect tileRect, Texture2D atlas) {\n            Color[] tilePixels = atlas.GetPixels((int)tileRect.xMin, (int)tileRect.yMin, (int)tileRect.width, (int)tileRect.height);\n            for (int i = 0; i < tilePixels.Length; i++) {\n                if (tilePixels[i].a != 0) {\n                    return false;\n                }\n            }\n            return true;\n        }\n\n\n    }\n}"
  },
  {
    "path": "Editor/Importers/GeneratedTileImporter.cs.meta",
    "content": "fileFormatVersion: 2\nguid: e707e63b3886d4776818b1dbcce3110d\nMonoImporter:\n  externalObjects: {}\n  serializedVersion: 2\n  defaultReferences: []\n  executionOrder: 0\n  icon: {instanceID: 0}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "Editor/Importers/ImporterVariant.cs",
    "content": "﻿using AsepriteImporter.Editors;\n\nnamespace AsepriteImporter.Importers\n{\n    public class ImporterVariant\n    {\n        public string Name { get; }\n        public SpriteImporter SpriteImporter { get; }\n        public SpriteImporter TileSetImporter { get; }\n        public SpriteImporterEditor Editor { get; }\n\n        public ImporterVariant(string name, SpriteImporter spriteImporter, SpriteImporter tileSetImporter, SpriteImporterEditor editor)\n        {\n            Name = name;\n            SpriteImporter = spriteImporter;\n            TileSetImporter = tileSetImporter;\n            Editor = editor;\n        }\n    }\n}"
  },
  {
    "path": "Editor/Importers/ImporterVariant.cs.meta",
    "content": "﻿fileFormatVersion: 2\nguid: 1a30fb0a9eb4478a84dc8983c0470784\ntimeCreated: 1609169037"
  },
  {
    "path": "Editor/Importers/SpriteImporter.cs",
    "content": "﻿using System;\nusing Aseprite;\nusing AsepriteImporter.Data;\nusing AsepriteImporter.Settings;\nusing UnityEditor;\nusing UnityEngine;\nusing Object = UnityEngine.Object;\n\n#if UNITY_2020_2_OR_NEWER\nusing UnityEditor.AssetImporters;\n#else\nusing UnityEditor.Experimental.AssetImporters;\n#endif\n\n\nnamespace AsepriteImporter\n{\n    public abstract class SpriteImporter\n    {\n        private const int UPDATE_LIMIT = 300;\n\n        private int updates;\n        private AseFileImporter importer;\n\n        protected AseFileImportSettings Settings => importer.settings;\n        protected AseFileTextureImportSettings TextureImportSettings => importer.textureImporterSettings;\n\n        protected AseFileAnimationSettings[] AnimationSettings\n        {\n            get => importer.animationSettings;\n            set => importer.animationSettings = value;\n        } \n\n        protected AseFileImporter Importer => importer;\n\n        protected AssetImportContext Context { get; private set; }\n        protected AseFile AsepriteFile { get; private set; }\n        protected string AssetPath { get; private set; }\n\n        protected Texture2D Texture\n        {\n            get => importer.texture;\n            set => importer.texture = value;\n        }\n\n        protected AseFileSpriteImportData[] SpriteImportData\n        {\n            get => importer.spriteImportData;\n            set => importer.spriteImportData = value;\n        }\n\n        protected SpriteRect[] SpriteRects\n        {\n            get => importer.spriteRects;\n            set => importer.spriteRects = value;\n        }\n\n        protected SpriteImporter(AseFileImporter importer)\n        {\n            this.importer = importer;\n        }\n\n        public virtual Sprite[] Sprites { get; }\n        \n        public void Import(AssetImportContext ctx, AseFile file)\n        {\n            Context = ctx;\n\n            AsepriteFile = file;\n            AssetPath = ctx.assetPath;\n            OnImport();\n            \n            updates = UPDATE_LIMIT;\n            EditorApplication.update += OnEditorUpdate;\n        }\n\n        public abstract void OnImport();\n\n        private void OnEditorUpdate()\n        {\n            AssetDatabase.Refresh();\n            var done = false;\n            if (OnUpdate()) {\n                done = true;\n            } else {\n                updates--;\n                if (updates <= 0) {\n                    done = true;\n                }\n            }\n\n            if (done) {\n                EditorApplication.update -= OnEditorUpdate;\n            }\n        }\n        \n        protected virtual bool OnUpdate()\n        {\n            return true;\n        }\n        \n        public virtual void Apply()\n        {\n            throw new NotImplementedException();\n        }\n\n        public virtual SpriteImportMode spriteImportMode { get; }\n        public virtual float pixelsPerUnit { get; }\n        public virtual Object targetObject { get; }\n    }\n}"
  },
  {
    "path": "Editor/Importers/SpriteImporter.cs.meta",
    "content": "﻿fileFormatVersion: 2\nguid: 3a438f2d21344562bf34c215f43a4c77\ntimeCreated: 1609163558"
  },
  {
    "path": "Editor/Importers.meta",
    "content": "﻿fileFormatVersion: 2\nguid: 6ea6cbd53073415fbfb69ea1cfafc46b\ntimeCreated: 1609163484"
  },
  {
    "path": "Editor/Settings/AseFileAnimationSettings.cs",
    "content": "﻿using System.Collections.Generic;\nusing UnityEngine;\n\nnamespace AsepriteImporter.Settings\n{\n    [System.Serializable]\n    public class AseFileAnimationSettings\n    {\n\n        public AseFileAnimationSettings()\n        {\n        }\n\n        public AseFileAnimationSettings(string name)\n        {\n            animationName = name;\n        }\n\n        [SerializeField] public string animationName;\n        [SerializeField] public bool loopTime = true;\n        [SerializeField] public string about;\n        [SerializeField] public Sprite[] sprites;\n        [SerializeField] public int[] frameNumbers;\n\n        public override string ToString()\n        {\n            return animationName;\n        }\n\n        public bool HasInvalidSprites\n        {\n            get\n            {\n                foreach (Sprite sprite in sprites)\n                {\n                    if (sprite == null)\n                        return true;\n                }\n\n                return false;\n            }\n        }\n    }\n}"
  },
  {
    "path": "Editor/Settings/AseFileAnimationSettings.cs.meta",
    "content": "﻿fileFormatVersion: 2\nguid: 2f2acbc6b84b42e0943697567a90089a\ntimeCreated: 1609163164"
  },
  {
    "path": "Editor/Settings/AseFileImportSettings.cs",
    "content": "using System;\nusing UnityEditor.Animations;\nusing UnityEngine;\n\n\nnamespace AsepriteImporter {\n    public enum AseFileImportType {\n        Sprite,\n        Tileset,\n    }\n\n    public enum TileNameType {\n        Index,\n        RowCol,\n    }\n\n    public enum EmptyTileBehaviour {\n        Keep,\n        Remove\n    }\n    \n    public enum AseAnimationBindType {\n        SpriteRenderer,\n        UIImage\n    }\n    \n    public enum AseAnimatorType {\n        None,\n        AnimatorController,\n        AnimatorOverrideController\n    }\n\n    public enum TransparencyMode {\n        Default,\n        Mask\n    }\n\n    [Serializable]\n    public class AseFileImportSettings {\n        [SerializeField] public AseFileImportType importType = AseFileImportType.Sprite;\n        [SerializeField] public TransparencyMode transparencyMode = TransparencyMode.Default;\n        [SerializeField] public Color transparentColor = Color.magenta;\n        [SerializeField] public int pixelsPerUnit = 16;\n        [SerializeField] public int spriteAlignment = 0;\n        [SerializeField] public Vector2 spritePivot = new Vector2(0.5f, 0.5f);\n\n        [SerializeField] public bool generateAnimations = true;\n        [SerializeField] public bool createAnimationAssets = false;\n        [SerializeField] public AseAnimationBindType bindType = AseAnimationBindType.SpriteRenderer;\n        [SerializeField] public AseAnimatorType animType = AseAnimatorType.None;\n        [SerializeField] public AnimatorController baseAnimator = null;\n        [SerializeField] public bool buildAtlas = false;\n\n        [SerializeField] public Vector2Int tileSize = new Vector2Int(16, 16);\n        [SerializeField] public TileNameType tileNameType = TileNameType.Index;\n        [SerializeField] public EmptyTileBehaviour tileEmpty = EmptyTileBehaviour.Keep;\n    }\n}"
  },
  {
    "path": "Editor/Settings/AseFileImportSettings.cs.meta",
    "content": "fileFormatVersion: 2\nguid: a945aa2a0df2d477bbf3b0e9682b2017\nMonoImporter:\n  externalObjects: {}\n  serializedVersion: 2\n  defaultReferences: []\n  executionOrder: 0\n  icon: {instanceID: 0}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "Editor/Settings/AseFileTextureImportSettings.cs",
    "content": "﻿using UnityEngine;\nusing UnityEditor;\nusing System;\n\nnamespace AsepriteImporter.Settings\n{\n\n    [Serializable]\n    public class AseFileTextureImportSettings\n    {\n        public bool seamlessCubemap;\n\n        //     Mip map bias of the texture.\n        public float mipmapBias = 0.5f;\n\n        //     Texture coordinate wrapping mode.\n        public TextureWrapMode wrapMode = TextureWrapMode.Clamp;\n\n        //     Texture U coordinate wrapping mode.\n        public TextureWrapMode wrapModeU;\n\n        //     Texture V coordinate wrapping mode.\n        public TextureWrapMode wrapModeV;\n\n        //     Texture W coordinate wrapping mode for Texture3D.\n        public TextureWrapMode wrapModeW;\n\n        //     If the provided alpha channel is transparency, enable this to dilate the color\n        //     to avoid filtering artifacts on the edges.\n        public bool alphaIsTransparency = true;\n\n        //     Sprite texture import mode.\n        public int spriteMode = (int) SpriteImportMode.Single;\n\n        //     The number of pixels in the sprite that correspond to one unit in world space.\n        public float spritePixelsPerUnit = 100;\n\n        //     The tessellation detail to be used for generating the mesh for the associated\n        //     sprite if the SpriteMode is set to Single. For Multiple sprites, use the SpriteEditor\n        //     to specify the value per sprite. Valid values are in the range [0-1], with higher\n        //     values generating a tighter mesh. A default of -1 will allow Unity to determine\n        //     the value automatically.\n        public float spriteTessellationDetail;\n\n        //     The number of blank pixels to leave between the edge of the graphic and the mesh.\n        public uint spriteExtrude = 1;\n\n        //     SpriteMeshType defines the type of Mesh that TextureImporter generates for a\n        //     Sprite.\n        public SpriteMeshType spriteMeshType = SpriteMeshType.Tight;\n\n        //     Edge-relative alignment of the sprite graphic.\n        public int spriteAlignment = (int) SpriteAlignment.Center;\n\n        //     Pivot point of the Sprite relative to its graphic's rectangle.\n        public Vector2 spritePivot = Vector2.zero;\n\n        //     Border sizes of the generated sprites.\n        public Vector4 spriteBorder = Vector4.zero;\n\n        //     Generates a default physics shape for a Sprite if a physics shape has not been\n        //     set by the user.\n        public bool spriteGenerateFallbackPhysicsShape = true;\n\n\n        //     Anisotropic filtering level of the texture.\n        public int aniso = 1;\n\n        //     Filtering mode of the texture.\n        public FilterMode filterMode = FilterMode.Point;\n\n        //     Convolution mode.\n        public TextureImporterCubemapConvolution cubemapConvolution;\n\n        //     Which type of texture are we dealing with here.\n        public TextureImporterType textureType = TextureImporterType.Sprite;\n\n        //     Shape of imported texture.\n        public TextureImporterShape textureShape = TextureImporterShape.Texture2D;\n\n        //     Mipmap filtering mode.\n        public TextureImporterMipFilter mipmapFilter;\n\n        //     Generate mip maps for the texture?\n        public bool mipmapEnabled = false;\n\n        //     Is texture storing color data?\n        public bool sRGBTexture = true;\n\n        //     Fade out mip levels to gray color?\n        public bool fadeOut = false;\n\n        //     Enable this to avoid colors seeping out to the edge of the lower Mip levels.\n        //     Used for light cookies.\n        public bool borderMipmap;\n\n        //     Enables or disables coverage-preserving alpha MIP mapping.\n        public bool mipMapsPreserveCoverage;\n\n        //     Mip level where texture begins to fade out to gray.\n        public int mipmapFadeDistanceStart = 1;\n\n        //     Returns or assigns the alpha test reference value.\n        public float alphaTestReferenceValue = 1f;\n\n        //     Convert heightmap to normal map?\n        public bool convertToNormalMap;\n\n        //     Amount of bumpyness in the heightmap.\n        public float heightmapScale;\n\n        //     Normal map filtering mode.\n        public TextureImporterNormalFilter normalMapFilter;\n\n        //     Select how the alpha of the imported texture is generated.\n        public TextureImporterAlphaSource alphaSource = TextureImporterAlphaSource.FromInput;\n\n        //     Color or Alpha component TextureImporterType|Single Channel Textures uses.\n        public TextureImporterSingleChannelComponent singleChannelComponent;\n\n        //     Is texture data readable from scripts.\n        public bool readable = false;\n\n        //     Enable mipmap streaming for this texture.\n        public bool streamingMipmaps;\n\n        //     Relative priority for this texture when reducing memory size in order to hit\n        //     the memory budget.\n        public int streamingMipmapsPriority;\n\n        //     Scaling mode for non power of two textures.\n        public TextureImporterNPOTScale npotScale;\n\n        //     Cubemap generation mode.\n        public TextureImporterGenerateCubemap generateCubemap;\n\n        //     Mip level where texture is faded out to gray completely.\n        public int mipmapFadeDistanceEnd = 3;\n\n\n\n\n        public TextureImporterSettings ToImporterSettings()\n        {\n            TextureImporterSettings settings = new TextureImporterSettings()\n            {\n                seamlessCubemap = seamlessCubemap,\n                mipmapBias = mipmapBias,\n                wrapMode = wrapMode,\n                wrapModeU = wrapModeU,\n                wrapModeV = wrapModeV,\n                wrapModeW = wrapModeW,\n                alphaIsTransparency = alphaIsTransparency,\n                spriteMode = spriteMode,\n                spritePixelsPerUnit = spritePixelsPerUnit,\n                spriteTessellationDetail = spriteTessellationDetail,\n                spriteExtrude = spriteExtrude,\n                spriteMeshType = spriteMeshType,\n                spriteAlignment = spriteAlignment,\n                spritePivot = spritePivot,\n                spriteBorder = spriteBorder,\n                spriteGenerateFallbackPhysicsShape = spriteGenerateFallbackPhysicsShape,\n                aniso = aniso,\n                filterMode = filterMode,\n                cubemapConvolution = cubemapConvolution,\n                textureType = textureType,\n                textureShape = textureShape,\n                mipmapFilter = mipmapFilter,\n                mipmapEnabled = mipmapEnabled,\n                sRGBTexture = sRGBTexture,\n                fadeOut = fadeOut,\n                borderMipmap = borderMipmap,\n                mipMapsPreserveCoverage = mipMapsPreserveCoverage,\n                mipmapFadeDistanceStart = mipmapFadeDistanceStart,\n                alphaTestReferenceValue = alphaTestReferenceValue,\n                convertToNormalMap = convertToNormalMap,\n                heightmapScale = heightmapScale,\n                normalMapFilter = normalMapFilter,\n                alphaSource = alphaSource,\n                singleChannelComponent = singleChannelComponent,\n                readable = readable,\n                streamingMipmaps = streamingMipmaps,\n                streamingMipmapsPriority = streamingMipmapsPriority,\n                npotScale = npotScale,\n                generateCubemap = generateCubemap,\n                mipmapFadeDistanceEnd = mipmapFadeDistanceEnd\n            };\n\n            return settings;\n        }\n\n        public void Apply(TextureImporterSettings settings)\n        {\n            this.seamlessCubemap = settings.seamlessCubemap;\n            this.mipmapBias = settings.mipmapBias;\n            this.wrapMode = settings.wrapMode;\n            this.wrapModeU = settings.wrapModeU;\n            this.wrapModeV = settings.wrapModeV;\n            this.wrapModeW = settings.wrapModeW;\n            this.alphaIsTransparency = settings.alphaIsTransparency;\n            this.spriteMode = settings.spriteMode;\n            this.spritePixelsPerUnit = settings.spritePixelsPerUnit;\n            this.spriteTessellationDetail = settings.spriteTessellationDetail;\n            this.spriteExtrude = settings.spriteExtrude;\n            this.spriteMeshType = settings.spriteMeshType;\n            this.spriteAlignment = settings.spriteAlignment;\n            this.spritePivot = settings.spritePivot;\n            this.spriteBorder = settings.spriteBorder;\n            this.spriteGenerateFallbackPhysicsShape = settings.spriteGenerateFallbackPhysicsShape;\n            this.aniso = settings.aniso;\n            this.filterMode = settings.filterMode;\n            this.cubemapConvolution = settings.cubemapConvolution;\n            this.textureType = settings.textureType;\n            this.textureShape = settings.textureShape;\n            this.mipmapFilter = settings.mipmapFilter;\n            this.mipmapEnabled = settings.mipmapEnabled;\n            this.sRGBTexture = settings.sRGBTexture;\n            this.fadeOut = settings.fadeOut;\n            this.borderMipmap = settings.borderMipmap;\n            this.mipMapsPreserveCoverage = settings.mipMapsPreserveCoverage;\n            this.mipmapFadeDistanceStart = settings.mipmapFadeDistanceStart;\n            this.alphaTestReferenceValue = settings.alphaTestReferenceValue;\n            this.convertToNormalMap = settings.convertToNormalMap;\n            this.heightmapScale = settings.heightmapScale;\n            this.normalMapFilter = settings.normalMapFilter;\n            this.alphaSource = settings.alphaSource;\n            this.singleChannelComponent = settings.singleChannelComponent;\n            this.readable = settings.readable;\n            this.streamingMipmaps = settings.streamingMipmaps;\n            this.streamingMipmapsPriority = settings.streamingMipmapsPriority;\n            this.npotScale = settings.npotScale;\n            this.generateCubemap = settings.generateCubemap;\n            this.mipmapFadeDistanceEnd = settings.mipmapFadeDistanceEnd;\n        }\n\n        public void ApplyTextureType(TextureImporterType textureType)\n        {\n            TextureImporterSettings settings = ToImporterSettings();\n            settings.ApplyTextureType(textureType);\n\n            Apply(settings);\n        }\n\n    }\n}"
  },
  {
    "path": "Editor/Settings/AseFileTextureImportSettings.cs.meta",
    "content": "﻿fileFormatVersion: 2\nguid: 7167839d3af2428189eaeaf275963ce4\ntimeCreated: 1609162624"
  },
  {
    "path": "Editor/Settings.meta",
    "content": "﻿fileFormatVersion: 2\nguid: 066aceed65d14461b9308ca93c60c8dd\ntimeCreated: 1609162574"
  },
  {
    "path": "Editor/SpriteAtlasBuilder.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing Aseprite.Utils;\nusing AsepriteImporter.Data;\nusing UnityEditor;\nusing UnityEngine;\n\nnamespace AsepriteImporter\n{\n    public class SpriteAtlasBuilder\n    {\n        private readonly Vector2Int spriteSize;\n        private int padding = 1;\n\n        \n        public SpriteAtlasBuilder()\n        {\n            spriteSize = new Vector2Int(16, 16);\n        }\n\n        public SpriteAtlasBuilder(Vector2Int spriteSize, int padding = 1)\n        {\n            this.spriteSize = spriteSize;\n            this.padding = padding;\n        }\n\n        public SpriteAtlasBuilder(int width, int height, int padding = 1)\n        {\n            spriteSize = new Vector2Int(width, height);\n            this.padding = padding;\n        }\n\n        public Texture2D GenerateAtlas(Texture2D[] sprites, out AseFileSpriteImportData[] spriteImportData, bool baseTwo = true)\n        {\n            int cols, rows;\n\n            CalculateColsRows(sprites.Length, spriteSize, out cols, out rows);\n\n            return GenerateAtlas(sprites, cols, rows, out spriteImportData, baseTwo);\n        }\n\n        public Texture2D GenerateAtlas(Texture2D[] sprites, int cols, int rows, out AseFileSpriteImportData[] spriteImportData, bool baseTwo = false)\n        {\n            spriteImportData = new AseFileSpriteImportData[sprites.Length];\n\n            var width = cols * spriteSize.x;\n            var height = rows * spriteSize.y;\n\n            if (baseTwo)\n            {\n                var baseTwoValue = CalculateNextBaseTwoValue(Math.Max(width, height));\n                width = baseTwoValue;\n                height = baseTwoValue;\n            }\n\n            var atlas = Texture2DUtil.CreateTransparentTexture(width, height);\n            var index = 0;\n\n            for (var row = 0; row < rows; ++row)\n            {\n                for (var col = 0; col < cols; ++col)\n                {\n                    Rect spriteRect = new Rect(col * spriteSize.x, atlas.height - ((row + 1) * spriteSize.y), spriteSize.x, spriteSize.y);\n                    Color[] colors = sprites[index].GetPixels();\n                    atlas.SetPixels((int)spriteRect.x, (int)spriteRect.y, (int)spriteRect.width, (int)spriteRect.height, sprites[index].GetPixels());\n                    atlas.Apply();\n\n                    List<Vector2[]> outline = GenerateRectOutline(spriteRect);\n                    spriteImportData[index] = CreateSpriteImportData(index.ToString(), spriteRect, outline);\n\n                    index++;\n                    if (index >= sprites.Length)\n                        break;\n                }\n                if (index >= sprites.Length)\n                    break;\n            }\n\n            return atlas;\n        }\n\n        public static List<Vector2Int[]> GenerateRectOutline(RectInt rect)\n        {\n            List<Vector2Int[]> outline = new List<Vector2Int[]>();\n\n            outline.Add(new Vector2Int[] { new Vector2Int(rect.x, rect.y), new Vector2Int(rect.x, rect.yMax) });\n            outline.Add(new Vector2Int[] { new Vector2Int(rect.x, rect.yMax), new Vector2Int(rect.xMax, rect.yMax) });\n            outline.Add(new Vector2Int[] { new Vector2Int(rect.xMax, rect.yMax), new Vector2Int(rect.xMax, rect.y) });\n            outline.Add(new Vector2Int[] { new Vector2Int(rect.xMax, rect.y), new Vector2Int(rect.x, rect.yMax) });\n\n            return outline;\n        }\n        \n        public static List<Vector2[]> GenerateRectOutline(Rect rect)\n        {\n            List<Vector2[]> outline = new List<Vector2[]>();\n\n            outline.Add(new Vector2[] { new Vector2(rect.x, rect.y), new Vector2(rect.x, rect.yMax) });\n            outline.Add(new Vector2[] { new Vector2(rect.x, rect.yMax), new Vector2(rect.xMax, rect.yMax) });\n            outline.Add(new Vector2[] { new Vector2(rect.xMax, rect.yMax), new Vector2(rect.xMax, rect.y) });\n            outline.Add(new Vector2[] { new Vector2(rect.xMax, rect.y), new Vector2(rect.x, rect.yMax) });\n\n            return outline;\n        }\n\n        private AseFileSpriteImportData CreateSpriteImportData(string name, Rect rect, List<Vector2[]> outline)\n        {\n            return new AseFileSpriteImportData()\n            {\n                alignment = SpriteAlignment.Center,\n                border = Vector4.zero,\n                name = name,\n                outline = outline,\n                pivot = new Vector2(0.5f, 0.5f),\n                rect = rect,\n                spriteID = GUID.Generate().ToString(),\n                tessellationDetail = 0\n            };\n        }\n\n        private static void CalculateColsRows(int spritesCount, Vector2 spriteSize, out int cols, out int rows)\n        {\n            float minDifference = float.MaxValue;\n            cols = spritesCount;\n            rows = 1;\n            \n            float width = spriteSize.x * cols;\n            float height = spriteSize.y * rows;\n\n            \n            \n            for (rows = 1; rows < spritesCount; ++rows)\n            {\n                cols = Mathf.CeilToInt((float)spritesCount / rows);\n                \n                width = spriteSize.x * cols;\n                height = spriteSize.y * rows;\n\n                float difference = Mathf.Abs(width - height);\n                if (difference < minDifference)\n                {\n                    minDifference = difference;\n                }\n                else\n                {\n                    rows -= 1;\n                    cols = Mathf.CeilToInt((float)spritesCount / rows);\n                    break;\n                }\n            }\n        }\n\n        private static int CalculateNextBaseTwoValue(int value)\n        {\n            var exponent = 0;\n            var baseTwo = 0;\n\n            while (baseTwo < value)\n            {\n                baseTwo = (int)Math.Pow(2, exponent);\n                exponent++;\n            }\n\n            return baseTwo;\n        }\n    }\n}"
  },
  {
    "path": "Editor/SpriteAtlasBuilder.cs.meta",
    "content": "﻿fileFormatVersion: 2\nguid: febab09ff43647eba5f8303231fd52e6\ntimeCreated: 1609175323"
  },
  {
    "path": "Editor.meta",
    "content": "fileFormatVersion: 2\nguid: adee30be46e6a884081541e4a6698a93\nfolderAsset: yes\nDefaultImporter:\n  externalObjects: {}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "GitHub/AsepriteImporterUnity.png.meta",
    "content": "fileFormatVersion: 2\nguid: e6200432066c82f44bcbb3f08a439629\nTextureImporter:\n  internalIDToNameTable: []\n  externalObjects: {}\n  serializedVersion: 10\n  mipmaps:\n    mipMapMode: 0\n    enableMipMap: 0\n    sRGBTexture: 1\n    linearTexture: 0\n    fadeOut: 0\n    borderMipMap: 0\n    mipMapsPreserveCoverage: 0\n    alphaTestReferenceValue: 0.5\n    mipMapFadeDistanceStart: 1\n    mipMapFadeDistanceEnd: 3\n  bumpmap:\n    convertToNormalMap: 0\n    externalNormalMap: 0\n    heightScale: 0.25\n    normalMapFilter: 0\n  isReadable: 0\n  streamingMipmaps: 0\n  streamingMipmapsPriority: 0\n  grayScaleToAlpha: 0\n  generateCubemap: 6\n  cubemapConvolution: 0\n  seamlessCubemap: 0\n  textureFormat: 1\n  maxTextureSize: 2048\n  textureSettings:\n    serializedVersion: 2\n    filterMode: -1\n    aniso: -1\n    mipBias: -100\n    wrapU: 1\n    wrapV: 1\n    wrapW: 1\n  nPOTScale: 0\n  lightmap: 0\n  compressionQuality: 50\n  spriteMode: 1\n  spriteExtrude: 1\n  spriteMeshType: 1\n  alignment: 0\n  spritePivot: {x: 0.5, y: 0.5}\n  spritePixelsToUnits: 100\n  spriteBorder: {x: 0, y: 0, z: 0, w: 0}\n  spriteGenerateFallbackPhysicsShape: 1\n  alphaUsage: 1\n  alphaIsTransparency: 1\n  spriteTessellationDetail: -1\n  textureType: 8\n  textureShape: 1\n  singleChannelComponent: 0\n  maxTextureSizeSet: 0\n  compressionQualitySet: 0\n  textureFormatSet: 0\n  platformSettings:\n  - serializedVersion: 3\n    buildTarget: DefaultTexturePlatform\n    maxTextureSize: 2048\n    resizeAlgorithm: 0\n    textureFormat: -1\n    textureCompression: 1\n    compressionQuality: 50\n    crunchedCompression: 0\n    allowsAlphaSplitting: 0\n    overridden: 0\n    androidETC2FallbackOverride: 0\n    forceMaximumCompressionQuality_BC6H_BC7: 0\n  spriteSheet:\n    serializedVersion: 2\n    sprites: []\n    outline: []\n    physicsShape: []\n    bones: []\n    spriteID: 5e97eb03825dee720800000000000000\n    internalID: 0\n    vertices: []\n    indices: \n    edges: []\n    weights: []\n    secondaryTextures: []\n  spritePackingTag: \n  pSDRemoveMatte: 0\n  pSDShowRemoveMatteOption: 0\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "GitHub/aseprite-importer-demo.gif.meta",
    "content": "fileFormatVersion: 2\nguid: 013f6a095c0e04e46b307c09cc983de8\nTextureImporter:\n  internalIDToNameTable: []\n  externalObjects: {}\n  serializedVersion: 10\n  mipmaps:\n    mipMapMode: 0\n    enableMipMap: 0\n    sRGBTexture: 1\n    linearTexture: 0\n    fadeOut: 0\n    borderMipMap: 0\n    mipMapsPreserveCoverage: 0\n    alphaTestReferenceValue: 0.5\n    mipMapFadeDistanceStart: 1\n    mipMapFadeDistanceEnd: 3\n  bumpmap:\n    convertToNormalMap: 0\n    externalNormalMap: 0\n    heightScale: 0.25\n    normalMapFilter: 0\n  isReadable: 0\n  streamingMipmaps: 0\n  streamingMipmapsPriority: 0\n  grayScaleToAlpha: 0\n  generateCubemap: 6\n  cubemapConvolution: 0\n  seamlessCubemap: 0\n  textureFormat: 1\n  maxTextureSize: 2048\n  textureSettings:\n    serializedVersion: 2\n    filterMode: -1\n    aniso: -1\n    mipBias: -100\n    wrapU: 1\n    wrapV: 1\n    wrapW: 1\n  nPOTScale: 0\n  lightmap: 0\n  compressionQuality: 50\n  spriteMode: 1\n  spriteExtrude: 1\n  spriteMeshType: 1\n  alignment: 0\n  spritePivot: {x: 0.5, y: 0.5}\n  spritePixelsToUnits: 100\n  spriteBorder: {x: 0, y: 0, z: 0, w: 0}\n  spriteGenerateFallbackPhysicsShape: 1\n  alphaUsage: 1\n  alphaIsTransparency: 1\n  spriteTessellationDetail: -1\n  textureType: 8\n  textureShape: 1\n  singleChannelComponent: 0\n  maxTextureSizeSet: 0\n  compressionQualitySet: 0\n  textureFormatSet: 0\n  platformSettings:\n  - serializedVersion: 3\n    buildTarget: DefaultTexturePlatform\n    maxTextureSize: 2048\n    resizeAlgorithm: 0\n    textureFormat: -1\n    textureCompression: 1\n    compressionQuality: 50\n    crunchedCompression: 0\n    allowsAlphaSplitting: 0\n    overridden: 0\n    androidETC2FallbackOverride: 0\n    forceMaximumCompressionQuality_BC6H_BC7: 0\n  spriteSheet:\n    serializedVersion: 2\n    sprites: []\n    outline: []\n    physicsShape: []\n    bones: []\n    spriteID: 5e97eb03825dee720800000000000000\n    internalID: 0\n    vertices: []\n    indices: \n    edges: []\n    weights: []\n    secondaryTextures: []\n  spritePackingTag: \n  pSDRemoveMatte: 0\n  pSDShowRemoveMatteOption: 0\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "GitHub/aseprite-transparency-demo.gif.meta",
    "content": "fileFormatVersion: 2\nguid: e85a5c97eb1aaae4f8295d18e399cec6\nTextureImporter:\n  internalIDToNameTable: []\n  externalObjects: {}\n  serializedVersion: 10\n  mipmaps:\n    mipMapMode: 0\n    enableMipMap: 0\n    sRGBTexture: 1\n    linearTexture: 0\n    fadeOut: 0\n    borderMipMap: 0\n    mipMapsPreserveCoverage: 0\n    alphaTestReferenceValue: 0.5\n    mipMapFadeDistanceStart: 1\n    mipMapFadeDistanceEnd: 3\n  bumpmap:\n    convertToNormalMap: 0\n    externalNormalMap: 0\n    heightScale: 0.25\n    normalMapFilter: 0\n  isReadable: 0\n  streamingMipmaps: 0\n  streamingMipmapsPriority: 0\n  grayScaleToAlpha: 0\n  generateCubemap: 6\n  cubemapConvolution: 0\n  seamlessCubemap: 0\n  textureFormat: 1\n  maxTextureSize: 2048\n  textureSettings:\n    serializedVersion: 2\n    filterMode: -1\n    aniso: -1\n    mipBias: -100\n    wrapU: 1\n    wrapV: 1\n    wrapW: 1\n  nPOTScale: 0\n  lightmap: 0\n  compressionQuality: 50\n  spriteMode: 1\n  spriteExtrude: 1\n  spriteMeshType: 1\n  alignment: 0\n  spritePivot: {x: 0.5, y: 0.5}\n  spritePixelsToUnits: 100\n  spriteBorder: {x: 0, y: 0, z: 0, w: 0}\n  spriteGenerateFallbackPhysicsShape: 1\n  alphaUsage: 1\n  alphaIsTransparency: 1\n  spriteTessellationDetail: -1\n  textureType: 8\n  textureShape: 1\n  singleChannelComponent: 0\n  maxTextureSizeSet: 0\n  compressionQualitySet: 0\n  textureFormatSet: 0\n  platformSettings:\n  - serializedVersion: 3\n    buildTarget: DefaultTexturePlatform\n    maxTextureSize: 2048\n    resizeAlgorithm: 0\n    textureFormat: -1\n    textureCompression: 1\n    compressionQuality: 50\n    crunchedCompression: 0\n    allowsAlphaSplitting: 0\n    overridden: 0\n    androidETC2FallbackOverride: 0\n    forceMaximumCompressionQuality_BC6H_BC7: 0\n  spriteSheet:\n    serializedVersion: 2\n    sprites: []\n    outline: []\n    physicsShape: []\n    bones: []\n    spriteID: 5e97eb03825dee720800000000000000\n    internalID: 0\n    vertices: []\n    indices: \n    edges: []\n    weights: []\n    secondaryTextures: []\n  spritePackingTag: \n  pSDRemoveMatte: 0\n  pSDShowRemoveMatteOption: 0\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "GitHub.meta",
    "content": "fileFormatVersion: 2\nguid: 60d91a37adfe8e44dbd70816f85a10a8\nfolderAsset: yes\nDefaultImporter:\n  externalObjects: {}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "LICENSE.md",
    "content": "                    GNU GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n                            Preamble\n\n  The GNU General Public License is a free, copyleft license for\nsoftware and other kinds of works.\n\n  The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works.  By contrast,\nthe GNU General Public License is intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users.  We, the Free Software Foundation, use the\nGNU General Public License for most of our software; it applies also to\nany other work released this way by its authors.  You can apply it to\nyour programs, too.\n\n  When we speak of free software, we are referring to freedom, not\nprice.  Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n  To protect your rights, we need to prevent others from denying you\nthese rights or asking you to surrender the rights.  Therefore, you have\ncertain responsibilities if you distribute copies of the software, or if\nyou modify it: responsibilities to respect the freedom of others.\n\n  For example, if you distribute copies of such a program, whether\ngratis or for a fee, you must pass on to the recipients the same\nfreedoms that you received.  You must make sure that they, too, receive\nor can get the source code.  And you must show them these terms so they\nknow their rights.\n\n  Developers that use the GNU GPL protect your rights with two steps:\n(1) assert copyright on the software, and (2) offer you this License\ngiving you legal permission to copy, distribute and/or modify it.\n\n  For the developers' and authors' protection, the GPL clearly explains\nthat there is no warranty for this free software.  For both users' and\nauthors' sake, the GPL requires that modified versions be marked as\nchanged, so that their problems will not be attributed erroneously to\nauthors of previous versions.\n\n  Some devices are designed to deny users access to install or run\nmodified versions of the software inside them, although the manufacturer\ncan do so.  This is fundamentally incompatible with the aim of\nprotecting users' freedom to change the software.  The systematic\npattern of such abuse occurs in the area of products for individuals to\nuse, which is precisely where it is most unacceptable.  Therefore, we\nhave designed this version of the GPL to prohibit the practice for those\nproducts.  If such problems arise substantially in other domains, we\nstand ready to extend this provision to those domains in future versions\nof the GPL, as needed to protect the freedom of users.\n\n  Finally, every program is threatened constantly by software patents.\nStates should not allow patents to restrict development and use of\nsoftware on general-purpose computers, but in those that do, we wish to\navoid the special danger that patents applied to a free program could\nmake it effectively proprietary.  To prevent this, the GPL assures that\npatents cannot be used to render the program non-free.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.\n\n                       TERMS AND CONDITIONS\n\n  0. Definitions.\n\n  \"This License\" refers to version 3 of the GNU General Public License.\n\n  \"Copyright\" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n  \"The Program\" refers to any copyrightable work licensed under this\nLicense.  Each licensee is addressed as \"you\".  \"Licensees\" and\n\"recipients\" may be individuals or organizations.\n\n  To \"modify\" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy.  The resulting work is called a \"modified version\" of the\nearlier work or a work \"based on\" the earlier work.\n\n  A \"covered work\" means either the unmodified Program or a work based\non the Program.\n\n  To \"propagate\" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy.  Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n  To \"convey\" a work means any kind of propagation that enables other\nparties to make or receive copies.  Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n  An interactive user interface displays \"Appropriate Legal Notices\"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License.  If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n  1. Source Code.\n\n  The \"source code\" for a work means the preferred form of the work\nfor making modifications to it.  \"Object code\" means any non-source\nform of a work.\n\n  A \"Standard Interface\" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n  The \"System Libraries\" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form.  A\n\"Major Component\", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n  The \"Corresponding Source\" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities.  However, it does not include the work's\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work.  For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n  The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n  The Corresponding Source for a work in source code form is that\nsame work.\n\n  2. Basic Permissions.\n\n  All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met.  This License explicitly affirms your unlimited\npermission to run the unmodified Program.  The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work.  This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n  You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force.  You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright.  Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n  Conveying under any other circumstances is permitted solely under\nthe conditions stated below.  Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n  3. Protecting Users' Legal Rights From Anti-Circumvention Law.\n\n  No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n  When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work's\nusers, your or third parties' legal rights to forbid circumvention of\ntechnological measures.\n\n  4. Conveying Verbatim Copies.\n\n  You may convey verbatim copies of the Program's source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n  You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n  5. Conveying Modified Source Versions.\n\n  You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n    a) The work must carry prominent notices stating that you modified\n    it, and giving a relevant date.\n\n    b) The work must carry prominent notices stating that it is\n    released under this License and any conditions added under section\n    7.  This requirement modifies the requirement in section 4 to\n    \"keep intact all notices\".\n\n    c) You must license the entire work, as a whole, under this\n    License to anyone who comes into possession of a copy.  This\n    License will therefore apply, along with any applicable section 7\n    additional terms, to the whole of the work, and all its parts,\n    regardless of how they are packaged.  This License gives no\n    permission to license the work in any other way, but it does not\n    invalidate such permission if you have separately received it.\n\n    d) If the work has interactive user interfaces, each must display\n    Appropriate Legal Notices; however, if the Program has interactive\n    interfaces that do not display Appropriate Legal Notices, your\n    work need not make them do so.\n\n  A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n\"aggregate\" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation's users\nbeyond what the individual works permit.  Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n  6. Conveying Non-Source Forms.\n\n  You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n    a) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by the\n    Corresponding Source fixed on a durable physical medium\n    customarily used for software interchange.\n\n    b) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by a\n    written offer, valid for at least three years and valid for as\n    long as you offer spare parts or customer support for that product\n    model, to give anyone who possesses the object code either (1) a\n    copy of the Corresponding Source for all the software in the\n    product that is covered by this License, on a durable physical\n    medium customarily used for software interchange, for a price no\n    more than your reasonable cost of physically performing this\n    conveying of source, or (2) access to copy the\n    Corresponding Source from a network server at no charge.\n\n    c) Convey individual copies of the object code with a copy of the\n    written offer to provide the Corresponding Source.  This\n    alternative is allowed only occasionally and noncommercially, and\n    only if you received the object code with such an offer, in accord\n    with subsection 6b.\n\n    d) Convey the object code by offering access from a designated\n    place (gratis or for a charge), and offer equivalent access to the\n    Corresponding Source in the same way through the same place at no\n    further charge.  You need not require recipients to copy the\n    Corresponding Source along with the object code.  If the place to\n    copy the object code is a network server, the Corresponding Source\n    may be on a different server (operated by you or a third party)\n    that supports equivalent copying facilities, provided you maintain\n    clear directions next to the object code saying where to find the\n    Corresponding Source.  Regardless of what server hosts the\n    Corresponding Source, you remain obligated to ensure that it is\n    available for as long as needed to satisfy these requirements.\n\n    e) Convey the object code using peer-to-peer transmission, provided\n    you inform other peers where the object code and Corresponding\n    Source of the work are being offered to the general public at no\n    charge under subsection 6d.\n\n  A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n  A \"User Product\" is either (1) a \"consumer product\", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling.  In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage.  For a particular\nproduct received by a particular user, \"normally used\" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product.  A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n  \"Installation Information\" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source.  The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n  If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information.  But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n  The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed.  Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n  Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n  7. Additional Terms.\n\n  \"Additional permissions\" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law.  If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n  When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit.  (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.)  You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n  Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n    a) Disclaiming warranty or limiting liability differently from the\n    terms of sections 15 and 16 of this License; or\n\n    b) Requiring preservation of specified reasonable legal notices or\n    author attributions in that material or in the Appropriate Legal\n    Notices displayed by works containing it; or\n\n    c) Prohibiting misrepresentation of the origin of that material, or\n    requiring that modified versions of such material be marked in\n    reasonable ways as different from the original version; or\n\n    d) Limiting the use for publicity purposes of names of licensors or\n    authors of the material; or\n\n    e) Declining to grant rights under trademark law for use of some\n    trade names, trademarks, or service marks; or\n\n    f) Requiring indemnification of licensors and authors of that\n    material by anyone who conveys the material (or modified versions of\n    it) with contractual assumptions of liability to the recipient, for\n    any liability that these contractual assumptions directly impose on\n    those licensors and authors.\n\n  All other non-permissive additional terms are considered \"further\nrestrictions\" within the meaning of section 10.  If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term.  If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n  If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n  Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n  8. Termination.\n\n  You may not propagate or modify a covered work except as expressly\nprovided under this License.  Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n  However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n  Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n  Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License.  If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n  9. Acceptance Not Required for Having Copies.\n\n  You are not required to accept this License in order to receive or\nrun a copy of the Program.  Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance.  However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work.  These actions infringe copyright if you do\nnot accept this License.  Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n  10. Automatic Licensing of Downstream Recipients.\n\n  Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License.  You are not responsible\nfor enforcing compliance by third parties with this License.\n\n  An \"entity transaction\" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations.  If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party's predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n  You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License.  For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n  11. Patents.\n\n  A \"contributor\" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based.  The\nwork thus licensed is called the contributor's \"contributor version\".\n\n  A contributor's \"essential patent claims\" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version.  For\npurposes of this definition, \"control\" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n  Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor's essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n  In the following three paragraphs, a \"patent license\" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement).  To \"grant\" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n  If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients.  \"Knowingly relying\" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient's use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n  If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n  A patent license is \"discriminatory\" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License.  You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n  Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n  12. No Surrender of Others' Freedom.\n\n  If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all.  For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n  13. Use with the GNU Affero General Public License.\n\n  Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU Affero General Public License into a single\ncombined work, and to convey the resulting work.  The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the special requirements of the GNU Affero General Public License,\nsection 13, concerning interaction through a network will apply to the\ncombination as such.\n\n  14. Revised Versions of this License.\n\n  The Free Software Foundation may publish revised and/or new versions of\nthe GNU General Public License from time to time.  Such new versions will\nbe similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n  Each version is given a distinguishing version number.  If the\nProgram specifies that a certain numbered version of the GNU General\nPublic License \"or any later version\" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation.  If the Program does not specify a version number of the\nGNU General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n  If the Program specifies that a proxy can decide which future\nversions of the GNU General Public License can be used, that proxy's\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n  Later license versions may give you additional or different\npermissions.  However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n  15. Disclaimer of Warranty.\n\n  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n  16. Limitation of Liability.\n\n  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n  17. Interpretation of Sections 15 and 16.\n\n  If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n                     END OF TERMS AND CONDITIONS\n\n            How to Apply These Terms to Your New Programs\n\n  If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n  To do so, attach the following notices to the program.  It is safest\nto attach them to the start of each source file to most effectively\nstate the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n    <one line to give the program's name and a brief idea of what it does.>\n    Copyright (C) <year>  <name of author>\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <https://www.gnu.org/licenses/>.\n\nAlso add information on how to contact you by electronic and paper mail.\n\n  If the program does terminal interaction, make it output a short\nnotice like this when it starts in an interactive mode:\n\n    <program>  Copyright (C) <year>  <name of author>\n    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\n    This is free software, and you are welcome to redistribute it\n    under certain conditions; type `show c' for details.\n\nThe hypothetical commands `show w' and `show c' should show the appropriate\nparts of the General Public License.  Of course, your program's commands\nmight be different; for a GUI interface, you would use an \"about box\".\n\n  You should also get your employer (if you work as a programmer) or school,\nif any, to sign a \"copyright disclaimer\" for the program, if necessary.\nFor more information on this, and how to apply and follow the GNU GPL, see\n<https://www.gnu.org/licenses/>.\n\n  The GNU General Public License does not permit incorporating your program\ninto proprietary programs.  If your program is a subroutine library, you\nmay consider it more useful to permit linking proprietary applications with\nthe library.  If this is what you want to do, use the GNU Lesser General\nPublic License instead of this License.  But first, please read\n<https://www.gnu.org/licenses/why-not-lgpl.html>.\n"
  },
  {
    "path": "LICENSE.md.meta",
    "content": "fileFormatVersion: 2\nguid: 69d89034a427d404082c48db5c4f70ce\nTextScriptImporter:\n  externalObjects: {}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "README.md",
    "content": "# Aseprite-Importer for Unity\n![AsepriteImporter Thumbnail](GitHub/AsepriteImporterUnity.png)\n\n\n[![openupm](https://img.shields.io/npm/v/io.tinu.asepriteimporter?label=openupm&registry_uri=https://package.openupm.com)](https://openupm.com/packages/io.tinu.asepriteimporter/)\n\nThis package helps you importing [.ase files](https://github.com/aseprite/aseprite/blob/master/docs/ase-file-specs.md) from [aseprite](https://www.aseprite.org/). The reader is fully written in C# which reads the compressed binary file and creates spritesheets, sprites and animations out of it.\n\n## Features\n* Creates a sprite sheet file (not dynamic)\n* Editable meta data like custom physics shapes with the 'Sprite Editor'\n* Generates tilemap with extended-padding (solves lines tearing issue between tiles)\n* Makes animation files (not dynamic)\n* Creates an animation controller\n* New tilemap name rule support (row-col)\n\n![Demo GIF of AsepriteImporter](GitHub/aseprite-importer-demo.gif)\n\n![image](https://user-images.githubusercontent.com/22926212/100529665-2cb66480-322d-11eb-82fa-5729572a75d9.png)\n![image](https://user-images.githubusercontent.com/22926212/100529680-57a0b880-322d-11eb-8e8a-e0b48ff0495b.png)\n![image](https://user-images.githubusercontent.com/22926212/100529693-7e5eef00-322d-11eb-8d46-5c7e03e958ce.png)\n\n\n## Install\n### OpenUPM\n#### Unity Package\nOpenUPM lets you install packages more easily by providing a downloadable unity package which will setup the package automatically.\nYou can find the download on the following link:\n\n[![openupm](https://img.shields.io/npm/v/io.tinu.asepriteimporter?label=openupm&registry_uri=https://package.openupm.com)](https://openupm.com/packages/io.tinu.asepriteimporter/) https://openupm.com/packages/io.tinu.asepriteimporter/\n\n\n#### CLI\n##### Prerequisites\n- [Node.js 12](https://nodejs.org/en/)\n- [openupm-cli](https://github.com/openupm/openupm-cli#openupm-cli).\n\nSee: https://openupm.com/docs/getting-started.html#installing-openupm-cli\n\n##### OpenUPM CLI Install\n\n```sh\n# Go to your Unity project directory\ncd YOUR_UNITY_PROJECT_DIR\n\n# Install package: io.tinu.asepriteimporter\nopenupm add io.tinu.asepriteimporter\n```\n### Unity\n* In Unity open the Package Manager (`Window > Package Manager`).\n* In the Package Manager click on the Plus-Icon in the top-left and select `Add package from git URL...`\n* Enter the URL of this Repository (`https://github.com/martinhodler/unity-aseprite-importer.git`) and press <kbd>Enter</kbd>\n\n## License\n\nSee LICENSE file.\n\nNote: As of Unity doesn't include any editor scripts in the game, you don't have to license your game under GPL.\n"
  },
  {
    "path": "README.md.meta",
    "content": "fileFormatVersion: 2\nguid: 9182addb22bd0ed479f3106f52338919\nTextScriptImporter:\n  externalObjects: {}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"io.tinu.asepriteimporter\",\n  \"displayName\": \"Aseprite Importer\",\n  \"version\": \"1.0.4\",\n  \"unity\": \"2019.2\",\n  \"unityRelease\": \"0a19\",\n  \"description\": \"An aseprite-file importer for unity written in C#, built upon the experimental AssetImporter API.\",\n  \"keywords\": [ \"Asset\", \"Importer\", \"AssetImporter\", \"Aseprite\", \"Textures\", \"Sprites\" ],\n  \"category\": \"Importers\",\n  \"dependencies\": {\n    \"com.unity.2d.sprite\": \"1.0.0\"\n  },\n  \"author\": {\n    \"name\": \"Unity AsepriteImporter (martinhodler, mjshin82, advra)\",\n    \"email\": \"contact@tinu.io\",\n    \"url\": \"https://github.com/martinhodler/unity-aseprite-importer\"\n  }\n}"
  },
  {
    "path": "package.json.meta",
    "content": "fileFormatVersion: 2\nguid: 9e2498235bfaf284793775eade0c4132\nTextScriptImporter:\n  externalObjects: {}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  }
]