Skip to content

Commit

Permalink
Merge tag '6.4.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
leohilbert committed Oct 11, 2024
2 parents c072867 + 5801c4d commit ca23fc2
Show file tree
Hide file tree
Showing 192 changed files with 11,190 additions and 3,606 deletions.
47 changes: 47 additions & 0 deletions Assets/LDtkUnity/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,50 @@
## [6.4.5](https://github.com/Cammin/LDtkToUnity/compare/6.4.4...6.4.5) (2024-09-23)


### Performance Improvements

* Fixed a time consuming issue for users with large projects where all separate levels would unnessesarily reimport upon any project file change (like changing a definition or merely moving a level). ([9460aa7](https://github.com/Cammin/LDtkToUnity/commit/9460aa7b9bd44245641f0750efc812aa6e0ade2d))

## [6.4.4](https://github.com/Cammin/LDtkToUnity/compare/6.4.3...6.4.4) (2024-09-10)


### Bug Fixes

* Fixed builds failing! Unity 6 was harming the serialization of .dll files for compiling/building in versions previous to it ([c680d83](https://github.com/Cammin/LDtkToUnity/commit/c680d83c19757ca3a0541cc9d3d56929d5db6811))

## [6.4.3](https://github.com/Cammin/LDtkToUnity/compare/6.4.2...6.4.3) (2024-09-05)


### Bug Fixes

* changed a log to give better instructions for investigating a tileset file's errors ([3ced4df](https://github.com/Cammin/LDtkToUnity/commit/3ced4df628eebbd5a29e92a04ed4364505bfa963))

## [6.4.2](https://github.com/Cammin/LDtkToUnity/compare/6.4.1...6.4.2) (2024-09-04)


### Bug Fixes

* Fix compile errors when the aseprite package is installed ([92e97fb](https://github.com/Cammin/LDtkToUnity/commit/92e97fb93c88b26a4301b8d94fe2ecf6b3ea8f91))

## [6.4.1](https://github.com/Cammin/LDtkToUnity/compare/6.4.0...6.4.1) (2024-09-04)


### Bug Fixes

* Fixed compile error on versions before Unity 6 ([44e8b8f](https://github.com/Cammin/LDtkToUnity/commit/44e8b8f17aaaeac8e18550bf10438a90ae868932))

# [6.4.0](https://github.com/Cammin/LDtkToUnity/compare/6.3.0...6.4.0) (2024-09-04)


### Bug Fixes

* Changed the tileset importer to use the filter from the original texture so that it's not always point filter, to potentially look better for high resolution textures ([1f2c179](https://github.com/Cammin/LDtkToUnity/commit/1f2c179cbb75003129731988654e38dd5f0ca84b))


### Features

* Added texture overrides for tileset files to scale up to high resolutions in Unity ([fa4d593](https://github.com/Cammin/LDtkToUnity/commit/fa4d593d923d7f636f73f9b450dc0e0ae0445871))

# [6.3.0](https://github.com/Cammin/LDtkToUnity/compare/6.2.3...6.3.0) (2024-07-29)


Expand Down
12 changes: 10 additions & 2 deletions Assets/LDtkUnity/Editor/Builders/TileBuildingJob.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,27 @@ internal sealed class LDtkTilesetImporterEditor : LDtkSubImporterEditor
protected override bool useAssetDrawPreview => true;

private SerializedProperty _ppuProp;
private SerializedProperty _overrideTextureProp;
private LDtkTilesetDefinitionWrapper _tilesetDef;

private static readonly GUIContent PpuContent = new GUIContent
{
text = "Pixels Per Unit",
tooltip = "The pixels per unit for this tileset. It should match with the source project importer's pixels per unit.",
};
private static readonly GUIContent OverrideTextureContent = new GUIContent
{
text = "Override Texture",
tooltip = "Choose a different texture, useful to make tile sprites of an increased resolution.\n" +
"Note: You can only choose textures that scale up equally to the original, like 1x, 2x, 3x, etc.\n" +
"You do NOT need to change the pixels per unit when using an override texture.",
};

public override void OnEnable()
{
base.OnEnable();
_ppuProp = serializedObject.FindProperty(LDtkTilesetImporter.PIXELS_PER_UNIT);
_overrideTextureProp = serializedObject.FindProperty(LDtkTilesetImporter.OVERRIDE_TEXTURE);
CacheImporter();

if (_importer == null || _importer.IsBackupFile())
Expand All @@ -38,6 +49,7 @@ public override void OnEnable()
}

_projectAsset = AssetDatabase.LoadMainAssetAtPath(_projectImporter.assetPath) as GameObject;
_tilesetDef = LDtkTilesetImporter.FromJson<LDtkTilesetDefinitionWrapper>(_importer.assetPath);
}

private void CacheImporter()
Expand All @@ -64,6 +76,7 @@ public override void OnInspectorGUI()
if (serializedObject.isEditingMultipleObjects)
{
DrawPpu();
DrawRedirect();
DrawDependenciesProperty();
serializedObject.ApplyModifiedProperties();
ApplyRevertGUI();
Expand All @@ -78,6 +91,7 @@ public override void OnInspectorGUI()
{
TryDrawProjectReferenceButton();
DrawPpu();
DrawRedirect();

if (_projectImporter)
{
Expand Down Expand Up @@ -158,8 +172,8 @@ private void DoOpenSpriteEditorButton()
GUILayout.EndHorizontal();
}
}
public void DrawPpu()

private void DrawPpu()
{
EditorGUILayout.PropertyField(_ppuProp, PpuContent);

Expand All @@ -169,5 +183,23 @@ public void DrawPpu()
_ppuProp.intValue = 1;
}
}

private void DrawRedirect()
{
EditorGUILayout.PropertyField(_overrideTextureProp, OverrideTextureContent);

if (!(_overrideTextureProp.objectReferenceValue is Texture2D overrideTexture))
{
return;
}

if (LDtkTilesetImporter.IsResolutionMultiple(overrideTexture.width, overrideTexture.height, _tilesetDef.Def.PxWid, _tilesetDef.Def.PxHei, out var multiplier))
{
EditorGUILayout.HelpBox($"Using multiple of {multiplier}.", MessageType.None, false);
return;
}

EditorGUILayout.HelpBox("The resolution of the override texture must be a multiple of the original texture.", MessageType.Error, true);
}
}
}
5 changes: 3 additions & 2 deletions Assets/LDtkUnity/Editor/ScriptedImporter/LDtkJsonDigger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,8 @@ private static bool GetSeparateLevelDependenciesReader(ref JsonReader reader, re
}

//BACKGROUND
if (propName == "bgRelPath" && reader.ReadIsNameSeparator())
//don't need to make separate levels depend upon the background, but keep code just in case
/*if (propName == "bgRelPath" && reader.ReadIsNameSeparator())
{
string valueBackground = reader.ReadString();
if (!string.IsNullOrEmpty(valueBackground))
Expand All @@ -355,7 +356,7 @@ private static bool GetSeparateLevelDependenciesReader(ref JsonReader reader, re
return true;
}
continue;
}
}*/
}

return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ public Sprite GetAdditionalSprite(LDtkProjectImporter project, TilesetDefinition
Sprite sprite = null;

LDtkProfiler.BeginSample("GetAdditionalSpriteForRectByRect");
sprite = artifacts.GetAdditionalSpriteForRect(id, def.PxHei);
sprite = artifacts.FindAdditionalSpriteForRect(id, def.PxHei);
LDtkProfiler.EndSample();
if (sprite)
{
Expand Down
Loading

0 comments on commit ca23fc2

Please sign in to comment.