diff --git a/Assets/LDtkUnity/Editor/Builders/LDtkBuilderIntGridValue.cs b/Assets/LDtkUnity/Editor/Builders/LDtkBuilderIntGridValue.cs index 42e83a89a..3e2adf70a 100644 --- a/Assets/LDtkUnity/Editor/Builders/LDtkBuilderIntGridValue.cs +++ b/Assets/LDtkUnity/Editor/Builders/LDtkBuilderIntGridValue.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using UnityEngine; using UnityEngine.Profiling; using UnityEngine.Tilemaps; diff --git a/Assets/LDtkUnity/Editor/Builders/LDtkBuilderLayer.cs b/Assets/LDtkUnity/Editor/Builders/LDtkBuilderLayer.cs index 177d54a33..1a34c7a48 100644 --- a/Assets/LDtkUnity/Editor/Builders/LDtkBuilderLayer.cs +++ b/Assets/LDtkUnity/Editor/Builders/LDtkBuilderLayer.cs @@ -1,5 +1,4 @@ -using UnityEditor; -using UnityEngine; +using UnityEngine; using UnityEngine.Tilemaps; namespace LDtkUnity.Editor diff --git a/Assets/LDtkUnity/Editor/CustomEditor/Importer/LDtkEditorCommandUpdater.cs b/Assets/LDtkUnity/Editor/CustomEditor/Importer/LDtkEditorCommandUpdater.cs index 5d9c3c864..43477b651 100644 --- a/Assets/LDtkUnity/Editor/CustomEditor/Importer/LDtkEditorCommandUpdater.cs +++ b/Assets/LDtkUnity/Editor/CustomEditor/Importer/LDtkEditorCommandUpdater.cs @@ -1,11 +1,7 @@ -using System.Collections.Generic; -using System.Diagnostics; +using System.Diagnostics; using System.IO; -using System.Linq; -using System.Net; using UnityEditor; using UnityEngine; -using Debug = UnityEngine.Debug; namespace LDtkUnity.Editor { diff --git a/Assets/LDtkUnity/Editor/CustomEditor/SectionDrawers/LDtkSectionMain.cs b/Assets/LDtkUnity/Editor/CustomEditor/SectionDrawers/LDtkSectionMain.cs index 72abf247c..03f3feaa7 100644 --- a/Assets/LDtkUnity/Editor/CustomEditor/SectionDrawers/LDtkSectionMain.cs +++ b/Assets/LDtkUnity/Editor/CustomEditor/SectionDrawers/LDtkSectionMain.cs @@ -2,7 +2,6 @@ using System.Linq; using UnityEditor; using UnityEngine; -using UnityEngine.U2D; namespace LDtkUnity.Editor { diff --git a/Assets/LDtkUnity/Editor/ExportNativePrefab/LDtkNativePrefabAssets.cs b/Assets/LDtkUnity/Editor/ExportNativePrefab/LDtkNativePrefabAssets.cs index 0446d0ed0..c902f057d 100644 --- a/Assets/LDtkUnity/Editor/ExportNativePrefab/LDtkNativePrefabAssets.cs +++ b/Assets/LDtkUnity/Editor/ExportNativePrefab/LDtkNativePrefabAssets.cs @@ -1,10 +1,8 @@ using System.Collections.Generic; using System.Linq; using UnityEditor; -using UnityEditor.U2D; using UnityEngine; using UnityEngine.Tilemaps; -using UnityEngine.U2D; namespace LDtkUnity.Editor { diff --git a/Assets/LDtkUnity/Editor/ExportNativePrefab/PathDrawer.cs b/Assets/LDtkUnity/Editor/ExportNativePrefab/PathDrawer.cs index 4242b5b7c..fa4a085e3 100644 --- a/Assets/LDtkUnity/Editor/ExportNativePrefab/PathDrawer.cs +++ b/Assets/LDtkUnity/Editor/ExportNativePrefab/PathDrawer.cs @@ -1,5 +1,4 @@ -using System; -using System.IO; +using System.IO; using UnityEditor; using UnityEngine; diff --git a/Assets/LDtkUnity/Editor/ParsedField/Parsed/LDtkParsedTile.cs b/Assets/LDtkUnity/Editor/ParsedField/Parsed/LDtkParsedTile.cs index ed787d53a..d51df8cf5 100644 --- a/Assets/LDtkUnity/Editor/ParsedField/Parsed/LDtkParsedTile.cs +++ b/Assets/LDtkUnity/Editor/ParsedField/Parsed/LDtkParsedTile.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using JetBrains.Annotations; using UnityEngine; diff --git a/Assets/LDtkUnity/Editor/ScriptedImporter/LDtkJsonImporter.cs b/Assets/LDtkUnity/Editor/ScriptedImporter/LDtkJsonImporter.cs index 1f5a18e67..b5d7449d0 100644 --- a/Assets/LDtkUnity/Editor/ScriptedImporter/LDtkJsonImporter.cs +++ b/Assets/LDtkUnity/Editor/ScriptedImporter/LDtkJsonImporter.cs @@ -3,7 +3,6 @@ using System.IO; using System.Linq; using System.Text.RegularExpressions; -using UnityEditor; using UnityEngine; using UnityEngine.Profiling; using UnityEngine.Tilemaps; diff --git a/Assets/LDtkUnity/Editor/ScriptedImporter/LDtkPpuInitializer.cs b/Assets/LDtkUnity/Editor/ScriptedImporter/LDtkPpuInitializer.cs index 9342c5446..71ecdaf68 100644 --- a/Assets/LDtkUnity/Editor/ScriptedImporter/LDtkPpuInitializer.cs +++ b/Assets/LDtkUnity/Editor/ScriptedImporter/LDtkPpuInitializer.cs @@ -1,5 +1,4 @@ using UnityEditor; -using UnityEngine; namespace LDtkUnity.Editor { diff --git a/Assets/LDtkUnity/Editor/ScriptedImporter/LDtkProjectImporter.cs b/Assets/LDtkUnity/Editor/ScriptedImporter/LDtkProjectImporter.cs index e7666d0a6..9e3220075 100644 --- a/Assets/LDtkUnity/Editor/ScriptedImporter/LDtkProjectImporter.cs +++ b/Assets/LDtkUnity/Editor/ScriptedImporter/LDtkProjectImporter.cs @@ -1,14 +1,10 @@ using System; using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text.RegularExpressions; using UnityEditor; using UnityEngine; using UnityEngine.Profiling; using UnityEngine.Tilemaps; -using UnityEngine.U2D; -using Utf8Json; using Object = UnityEngine.Object; #if UNITY_2020_2_OR_NEWER using UnityEditor.AssetImporters; diff --git a/Assets/LDtkUnity/Editor/ScriptedImporter/LDtkTilesetImporter.cs b/Assets/LDtkUnity/Editor/ScriptedImporter/LDtkTilesetImporter.cs index 2ad10a09d..2cdc95a77 100644 --- a/Assets/LDtkUnity/Editor/ScriptedImporter/LDtkTilesetImporter.cs +++ b/Assets/LDtkUnity/Editor/ScriptedImporter/LDtkTilesetImporter.cs @@ -2,7 +2,6 @@ using System.Collections.Generic; using System.IO; using System.Linq; -using System.Reflection; using System.Text; using Unity.Collections; using UnityEditor; @@ -29,6 +28,8 @@ namespace LDtkUnity.Editor [ScriptedImporter(LDtkImporterConsts.TILESET_VERSION, LDtkImporterConsts.TILESET_EXT, LDtkImporterConsts.TILESET_ORDER)] internal sealed partial class LDtkTilesetImporter : LDtkJsonImporter { + private static bool _willRefreshTilemapsInScene; + public const string PIXELS_PER_UNIT = nameof(_pixelsPerUnit); [SerializeField] internal int _pixelsPerUnit = -1; @@ -319,8 +320,6 @@ string MakeAssetName() Debug.Assert(_additionalTiles.Count == additionalRects.Count); } - - public static bool WillRefreshTilemapsInScene; private static void TilemapColliderTileUpdate() { @@ -330,16 +329,16 @@ private static void TilemapColliderTileUpdate() //Using 2023.1+ is much more optimized for this sort of thing. //This is unfortunately a slow procedure, but there is currently no easy solution found for refreshing tilemap colliders in the scene. - if (WillRefreshTilemapsInScene) + if (_willRefreshTilemapsInScene) { return; } - WillRefreshTilemapsInScene = true; + _willRefreshTilemapsInScene = true; EditorApplication.delayCall += () => { Profiler.BeginSample("TilemapColliderTileUpdate"); - WillRefreshTilemapsInScene = false; + _willRefreshTilemapsInScene = false; #if UNITY_2023_1_OR_NEWER TilemapCollider2D[] colliders = Object.FindObjectsByType(FindObjectsInactive.Include, FindObjectsSortMode.None); diff --git a/Assets/LDtkUnity/Editor/ScriptedImporter/LDtkTilesetImporterModules.cs b/Assets/LDtkUnity/Editor/ScriptedImporter/LDtkTilesetImporterModules.cs index 819b92e2b..76143d34e 100644 --- a/Assets/LDtkUnity/Editor/ScriptedImporter/LDtkTilesetImporterModules.cs +++ b/Assets/LDtkUnity/Editor/ScriptedImporter/LDtkTilesetImporterModules.cs @@ -2,8 +2,6 @@ using System.Collections.Generic; using System.Linq; using UnityEditor; -using UnityEditor.AssetImporters; -using UnityEditor.U2D; using UnityEditor.U2D.Sprites; using UnityEngine; using UnityEngine.Profiling; diff --git a/Assets/LDtkUnity/Editor/Utility/Artifacts/LDtkArtifactFactory.cs b/Assets/LDtkUnity/Editor/Utility/Artifacts/LDtkArtifactFactory.cs index dd5a0bdd6..eadc56487 100644 --- a/Assets/LDtkUnity/Editor/Utility/Artifacts/LDtkArtifactFactory.cs +++ b/Assets/LDtkUnity/Editor/Utility/Artifacts/LDtkArtifactFactory.cs @@ -1,7 +1,5 @@ -using UnityEngine; +#if UNITY_2020_2_OR_NEWER -#if UNITY_2020_2_OR_NEWER -using UnityEditor.AssetImporters; #else using UnityEditor.Experimental.AssetImporters; #endif diff --git a/Assets/LDtkUnity/Editor/Utility/Artifacts/LDtkBackgroundArtifactFactory.cs b/Assets/LDtkUnity/Editor/Utility/Artifacts/LDtkBackgroundArtifactFactory.cs index c06cc7c0e..288d646f9 100644 --- a/Assets/LDtkUnity/Editor/Utility/Artifacts/LDtkBackgroundArtifactFactory.cs +++ b/Assets/LDtkUnity/Editor/Utility/Artifacts/LDtkBackgroundArtifactFactory.cs @@ -1,11 +1,5 @@ using UnityEngine; -#if UNITY_2020_2_OR_NEWER -using UnityEditor.AssetImporters; -#else -using UnityEditor.Experimental.AssetImporters; -#endif - namespace LDtkUnity.Editor { internal sealed class LDtkBackgroundArtifactFactory : LDtkArtifactFactory diff --git a/Assets/LDtkUnity/Editor/Utility/Artifacts/LDtkBackgroundSliceCreator.cs b/Assets/LDtkUnity/Editor/Utility/Artifacts/LDtkBackgroundSliceCreator.cs index d7a01972c..29b006e83 100644 --- a/Assets/LDtkUnity/Editor/Utility/Artifacts/LDtkBackgroundSliceCreator.cs +++ b/Assets/LDtkUnity/Editor/Utility/Artifacts/LDtkBackgroundSliceCreator.cs @@ -1,6 +1,4 @@ -using System; -using System.Collections.Generic; -using UnityEditor.AssetImporters; +using System.Collections.Generic; using UnityEngine; using UnityEngine.Profiling; diff --git a/Assets/LDtkUnity/Editor/Utility/Artifacts/LDtkTilesetDefExporter.cs b/Assets/LDtkUnity/Editor/Utility/Artifacts/LDtkTilesetDefExporter.cs deleted file mode 100644 index b94b278f4..000000000 --- a/Assets/LDtkUnity/Editor/Utility/Artifacts/LDtkTilesetDefExporter.cs +++ /dev/null @@ -1,330 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Security.Cryptography; -using UnityEditor; -using UnityEngine; -using UnityEngine.Profiling; - -#if UNITY_2020_2_OR_NEWER -using UnityEditor.AssetImporters; -#else -using UnityEditor.Experimental.AssetImporters; -#endif - -namespace LDtkUnity.Editor -{ - /// - /// This is the master class for creating tiles+sprite, and backgrounds. It's also ideally the only time we should load textures. - /// This also will create and export the tileset definition file. - /// - /// The previous method just had made sprites based on any first occurrence. - /// The new way of creating sprites are doing to be localized to individual tileset definitions so that we can make the separate importing - /// - /*internal sealed class LDtkTilesetDefExporter - { - private readonly int _pixelsPerUnit; - private readonly string _projectPath; - - //todo converting from sprite actions into giving to the tileset definition, and MOVING the tile actions to the artifact factory for the - - - public LDtkTilesetDefExporter(string projectPath, int pixelsPerUnit) - { - _pixelsPerUnit = pixelsPerUnit; - _projectPath = projectPath; - } - - - /// - /// Figure out what malformed tiles should generate, and then export a tileset definition file for every tileset definition of this project - /// - public void ExportTilesetDefinitions(LdtkJson json) - { - Profiler.BeginSample("GetFieldSlicesAndUsedTileSlices"); - var fieldSlices = GetAllAdditionalSpritesInProject(json); - Profiler.EndSample(); - - Profiler.BeginSample("Export Tileset Definitions"); - foreach (TilesetDefinition def in json.Defs.Tilesets) - { - Profiler.BeginSample($"Export {def.Identifier}"); - ExportTilesetDefinition(def, fieldSlices); - Profiler.EndSample(); - } - Profiler.EndSample(); - } - - /// - ///Dict of (TilesetUid => Rects) - /// - /// Gets any and all information of used tiles. tiles from level/entity fields. these are the tiles that could have a size that deviates from the tileset definition's gridSize - /// Important: when we get the slices inside levels, we need to dig into json for some of these. - /// Because we are looking for tile instances in levels, - /// Technically we only need to grab the malformed tiles; the ones that are not in equal width/height of the layer's gridsize. - /// This is because all of the gridsize tiles are going to be generated regardless. - /// The instances where this can be the case are: editor visual for enum def value, editor visual for entity, and tile fields from levels/entities - /// - private Dictionary> GetAllAdditionalSpritesInProject(LdtkJson json) - { - Dictionary> fieldSlices = new Dictionary>(); - - foreach (World world in json.UnityWorlds) - { - foreach (Level level in world.Levels) - { - //Entity tile fields. If external levels, then dig into the level. If in our own json, then we can safely get them from the layer instances in the json. - if (json.ExternalLevels) - { - string levelPath = new LDtkRelativeGetterLevels().GetPath(level, _projectPath); - List fields = new List(); - if (!LDtkJsonDigger.GetUsedFieldTiles(levelPath, ref fields)) - { - LDtkDebug.LogError($"Couldn't get entity tile field instance for level: {level.Identifier}"); - continue; - } - - foreach (FieldInstance field in fields) - { - TryAddFieldInstance(field); - } - continue; - } - - //NOTICE: depending on performance from directly getting json data instead of digging, i'll release this back. - //else it's not external levels and can ge grabbed from the json data for better performance - //Level field instances are still available in project json even with separate levels. They are both available in project and separate level files - - //level's field instances - foreach (FieldInstance levelFieldInstance in level.FieldInstances) - { - TryAddFieldInstance(levelFieldInstance); - } - - //entity field instances - foreach (LayerInstance layer in level.LayerInstances) - { - foreach (EntityInstance entity in layer.EntityInstances) - { - foreach (FieldInstance entityField in entity.FieldInstances) - { - TryAddFieldInstance(entityField); - } - } - } - - void TryAddFieldInstance(FieldInstance field) - { - if (!field.IsTile) - { - return; - } - - TilesetRectangle[] rects = GetTilesetRectanglesFromField(field); - if (rects == null) - { - return; - } - foreach (TilesetRectangle rect in rects) //the expected value here is a string of the field.Value - { - //Debug.Log($"Element {element}"); - if (rect == null) - { - LDtkDebug.LogError($"A FieldInstance element was null for {field.Identifier}"); - continue; - } - - //deny adding duplicated to avoid identifier uniqueness - int key = rect.TilesetUid; - if (!fieldSlices.ContainsKey(key)) - { - fieldSlices.Add(key, new HashSet()); - } - fieldSlices[key].Add(rect.UnityRectInt); - } - } - } - } - return fieldSlices; - } - - private TilesetRectangle[] GetTilesetRectanglesFromField(FieldInstance field) - { - //if it's prebuilt via the json digger - if (field.Value is TilesetRectangle[] arrayRects) - { - return arrayRects; - } - - bool isArray = field.Definition.IsArray; - - //if it was a single null value - if (field.Value == null) - { - if (isArray) - { - Debug.LogError($"Null array? This is never supposed to be reached."); - } - - return null; - } - - - if (isArray) - { - if (field.Value is List rectangles) - { - return rectangles.Select(LDtkParsedTile.ConvertDict).Where(p => p != null).ToArray(); - } - - Debug.LogError($"This is never supposed to be reached. {field.Identifier} {field.Value.GetType()}"); - return null; - } - - if (field.Value is Dictionary dict) - { - return new TilesetRectangle[] {LDtkParsedTile.ConvertDict(dict)}; - } - - //this could be if we did a json dig to construct this array - if (field.Value is TilesetRectangle[] rects) - { - return rects; - } - - Debug.LogError($"This is never supposed to be reached. {field.Identifier} {field.Value.GetType()}"); - return null; - } - - public static string TilesetExportPath(string projectImporterPath, TilesetDefinition def) - { - string directoryName = Path.GetDirectoryName(projectImporterPath); - string projectName = Path.GetFileNameWithoutExtension(projectImporterPath); - - if (directoryName == null) - { - LDtkDebug.Log($"Issue formulating a tileset definition path; Path was invalid for: {projectImporterPath}"); - return null; - } - - return Path.Combine(directoryName, projectName, def.Identifier) + '.' + LDtkImporterConsts.TILESET_EXT; - } - - private void ExportTilesetDefinition(TilesetDefinition def, Dictionary> rectsToGenerate) - { - string writePath = TilesetExportPath(_projectPath, def); - - LDtkPathUtility.TryCreateDirectoryForFile(writePath); - - LDtkTilesetDefinition data = new LDtkTilesetDefinition() - { - Def = def, - Ppu = _pixelsPerUnit, - }; - - if (rectsToGenerate.TryGetValue(def.Uid, out HashSet rects)) - { - Debug.Log($"Got field slices for def {def.Identifier}: {rects.Count}"); - data.Rects = rects.Select(LDtkTilesetDefinition.TilesetRect.FromRectInt).ToList(); - } - - byte[] bytes; - try - { - bytes = data.ToJson(); - } - catch (Exception e) - { - LDtkDebug.LogError($"Failed to ToJson a tileset definition of {def.Identifier}: {e}"); - return; - } - - bool existsBeforehand = File.Exists(writePath); - byte[] oldHash = Array.Empty(); - if (existsBeforehand) - { - oldHash = GetFileHash(writePath); - } - - File.WriteAllBytes(writePath, bytes); - byte[] newHash = GetFileHash(writePath); - - if (!existsBeforehand || !oldHash.SequenceEqual(newHash)) - { - Debug.Log("FORCE reimport for tileset because it's new hash or didnt exist before"); - AssetDatabase.ImportAsset(writePath); - //AssetDatabase.ImportAsset(writePath, ImportAssetOptions.ForceUpdate); - //AssetDatabase.ImportAsset(writePath, ImportAssetOptions.ForceSynchronousImport | ImportAssetOptions.ForceUpdate); - //AssetDatabase.Refresh(ImportAssetOptions.ForceSynchronousImport | ImportAssetOptions.ForceUpdate); - - //AssetDatabase.import - - var importer = AssetImporter.GetAtPath(writePath); - - if (importer is LDtkTilesetImporter tilesetImporter) - { - Debug.Log($"Good! {tilesetImporter.assetPath}"); - } - else - { - Debug.LogError("Bad !!!"); - } - - } - } - - private byte[] GetFileHash(string fileName) - { - HashAlgorithm sha1 = HashAlgorithm.Create(); - using (FileStream stream = new FileStream(fileName,FileMode.Open,FileAccess.Read)) - return sha1.ComputeHash(stream); - } - - //todo might be usable later for aseprite - private static Texture2D CreateTex(TilesetDefinition def, Texture2D srcTex) - { - int gridSize = def.TileGridSize; - int w = def.PxWid; - int h = def.PxHei; - - Texture2D newTex = new Texture2D(srcTex.width + gridSize, srcTex.height + gridSize, srcTex.format, 0, false); - newTex.alphaIsTransparency = true; - - Graphics.CopyTexture(srcTex, 0, 0, 0, 0, srcTex.width, srcTex.height, newTex, 0, 0, 0, gridSize); - newTex.Apply(); - - for (int y = gridSize; y < newTex.height; y++) - { - //Color c = newTex.GetPixel(5, h - 10); - Color c = newTex.GetPixel(w-1, y); - //Debug.Log($"got pixel at {w},{y} being {c}"); - for (int x = w; x < newTex.width; x++) - { - //Debug.Log($"set px at {x}, {y}"); - newTex.SetPixel(x, y, c); - } - } - for (int x = 0; x < w; x++) - { - Color c = newTex.GetPixel(x, gridSize+1); - for (int y = 0; y < gridSize; y++) - { - newTex.SetPixel(x, y, c); - } - } - - Color bottomLeftColor = newTex.GetPixel(w-1, 0); - for (int x = w; x < newTex.width; x++) - { - for (int y = 0; y < gridSize; y++) - { - newTex.SetPixel(x, y, bottomLeftColor); - } - } - - newTex.Apply(); - return newTex; - } - }*/ -} \ No newline at end of file diff --git a/Assets/LDtkUnity/Editor/Utility/Artifacts/LDtkTilesetDefExporter.cs.meta b/Assets/LDtkUnity/Editor/Utility/Artifacts/LDtkTilesetDefExporter.cs.meta deleted file mode 100644 index 60005af6f..000000000 --- a/Assets/LDtkUnity/Editor/Utility/Artifacts/LDtkTilesetDefExporter.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: d10a534728a94cd49bf85edbd077adef -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/LDtkUnity/Editor/Utility/Dependencies/LDtkProjectDependencyFactory.cs b/Assets/LDtkUnity/Editor/Utility/Dependencies/LDtkProjectDependencyFactory.cs index 876c69f56..ff29bff9f 100644 --- a/Assets/LDtkUnity/Editor/Utility/Dependencies/LDtkProjectDependencyFactory.cs +++ b/Assets/LDtkUnity/Editor/Utility/Dependencies/LDtkProjectDependencyFactory.cs @@ -1,9 +1,6 @@ using System; using System.Collections.Generic; -using System.IO; using System.Linq; -using UnityEngine; -using Utf8Json; namespace LDtkUnity.Editor { diff --git a/Assets/LDtkUnity/Editor/Utility/LDtkTilesetExporterUtility.cs b/Assets/LDtkUnity/Editor/Utility/LDtkTilesetExporterUtility.cs index 58e98c321..c38c84aa1 100644 --- a/Assets/LDtkUnity/Editor/Utility/LDtkTilesetExporterUtility.cs +++ b/Assets/LDtkUnity/Editor/Utility/LDtkTilesetExporterUtility.cs @@ -1,7 +1,6 @@ using System; using System.Diagnostics; using System.IO; -using UnityEditor; using UnityEngine; using Debug = UnityEngine.Debug; diff --git a/Assets/LDtkUnity/Editor/Utility/RelativeGetter/LDtkRelativeGetter.cs b/Assets/LDtkUnity/Editor/Utility/RelativeGetter/LDtkRelativeGetter.cs index b7c4541be..2d652c6bc 100644 --- a/Assets/LDtkUnity/Editor/Utility/RelativeGetter/LDtkRelativeGetter.cs +++ b/Assets/LDtkUnity/Editor/Utility/RelativeGetter/LDtkRelativeGetter.cs @@ -1,6 +1,5 @@ using System.IO; using UnityEditor; -using UnityEditor.AssetImporters; using UnityEngine; using UnityEngine.Profiling; diff --git a/Assets/LDtkUnity/InternalBridge/InternalEditorBridge.cs b/Assets/LDtkUnity/InternalBridge/InternalEditorBridge.cs index 51be13de4..4294a6bf2 100644 --- a/Assets/LDtkUnity/InternalBridge/InternalEditorBridge.cs +++ b/Assets/LDtkUnity/InternalBridge/InternalEditorBridge.cs @@ -5,7 +5,6 @@ using UnityEditor.U2D.Sprites; using UnityEngine; using UnityEngine.Events; -using UnityEngine.UIElements; namespace LDtkUnity.InternalBridge { diff --git a/Assets/LDtkUnity/Runtime/Data/Extensions/Definition/TilesetDefinition.cs b/Assets/LDtkUnity/Runtime/Data/Extensions/Definition/TilesetDefinition.cs index 09063e5f3..f76509cdd 100644 --- a/Assets/LDtkUnity/Runtime/Data/Extensions/Definition/TilesetDefinition.cs +++ b/Assets/LDtkUnity/Runtime/Data/Extensions/Definition/TilesetDefinition.cs @@ -1,9 +1,6 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Runtime.Serialization; using UnityEngine; -using UnityEngine.Internal; -using Utf8Json.Resolvers; namespace LDtkUnity { diff --git a/Assets/LDtkUnity/Runtime/Tools/LDtkDebug.cs b/Assets/LDtkUnity/Runtime/Tools/LDtkDebug.cs index 3731cd3f8..effdd399b 100644 --- a/Assets/LDtkUnity/Runtime/Tools/LDtkDebug.cs +++ b/Assets/LDtkUnity/Runtime/Tools/LDtkDebug.cs @@ -2,14 +2,6 @@ using UnityEditor; using UnityEngine; -#if UNITY_EDITOR -#if UNITY_2020_2_OR_NEWER -using UnityEditor.AssetImporters; -#else -using UnityEditor.Experimental.AssetImporters; -#endif -#endif - namespace LDtkUnity { //because logging the same message hundreds of times is very slow, we'll limit the max of the same log up to a certain amount diff --git a/Assets/LDtkUnity/Runtime/Tools/LDtkKeyFormatUtil.cs b/Assets/LDtkUnity/Runtime/Tools/LDtkKeyFormatUtil.cs index ffc7a9b22..74722b446 100644 --- a/Assets/LDtkUnity/Runtime/Tools/LDtkKeyFormatUtil.cs +++ b/Assets/LDtkUnity/Runtime/Tools/LDtkKeyFormatUtil.cs @@ -1,8 +1,5 @@ using System.Collections.Generic; -using System.IO; using System.Text; -using UnityEngine; -using UnityEngine.Profiling; namespace LDtkUnity { diff --git a/Assets/LDtkUnity/Runtime/UnityAssets/Json/LDtkTilesetDefinition.cs b/Assets/LDtkUnity/Runtime/UnityAssets/Json/LDtkTilesetDefinition.cs index 821aa27b3..8b14245e8 100644 --- a/Assets/LDtkUnity/Runtime/UnityAssets/Json/LDtkTilesetDefinition.cs +++ b/Assets/LDtkUnity/Runtime/UnityAssets/Json/LDtkTilesetDefinition.cs @@ -1,8 +1,6 @@ using System; using System.Collections.Generic; using UnityEngine; -using UnityEngine.Internal; -using UnityEngine.Serialization; using Utf8Json; namespace LDtkUnity diff --git a/Assets/Tests/Misc/OtherTechTests/TestAllFields/TestAllFieldsAssetReferences.cs b/Assets/Tests/Misc/OtherTechTests/TestAllFields/TestAllFieldsAssetReferences.cs index 714590c18..e964e0f6d 100644 --- a/Assets/Tests/Misc/OtherTechTests/TestAllFields/TestAllFieldsAssetReferences.cs +++ b/Assets/Tests/Misc/OtherTechTests/TestAllFields/TestAllFieldsAssetReferences.cs @@ -1,4 +1,3 @@ -using System.Collections; using System.Collections.Generic; using UnityEngine; diff --git a/Assets/Tests/PlayMode/Fixtures/FieldsFixture.cs b/Assets/Tests/PlayMode/Fixtures/FieldsFixture.cs index f45ae9f67..362ff74cb 100644 --- a/Assets/Tests/PlayMode/Fixtures/FieldsFixture.cs +++ b/Assets/Tests/PlayMode/Fixtures/FieldsFixture.cs @@ -1,6 +1,5 @@ using NUnit.Framework; using UnityEngine; -using UnityEngine.TestTools; namespace LDtkUnity.Tests {