Skip to content

Commit 0faa016

Browse files
committed
Merge tag '6.12.3'
2 parents d3a39ba + df81831 commit 0faa016

144 files changed

Lines changed: 856 additions & 150 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/test-runner.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,14 @@ jobs:
1616
testMode:
1717
#- playmode
1818
- editmode
19-
unityVersion:
19+
unityVersion: # All are LTS except minimum supported version
2020
- 2019.3.15f1
2121
- 2019.4.40f1
2222
- 2020.3.48f1
2323
- 2021.3.45f1
2424
- 2022.3.43f1
25-
- 6000.0.23f1
25+
- 6000.0.64f1
26+
- 6000.3.2f1
2627

2728
steps:
2829
#Test Checkout

.github/workflows/unity-builder.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,14 @@ jobs:
1616
targetPlatform:
1717
- StandaloneWindows
1818
#- WebGL
19-
unityVersion:
19+
unityVersion: # All are LTS except minimum supported version
2020
- 2019.3.15f1
2121
- 2019.4.40f1
2222
- 2020.3.48f1
2323
- 2021.3.45f1
2424
- 2022.3.43f1
25-
- 6000.0.23f1
25+
- 6000.0.64f1
26+
- 6000.3.2f1
2627

2728
include:
2829
- targetPlatform: WebGL

Assets/LDtkUnity/CHANGELOG.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,72 @@
1+
## [6.12.3](https://github.com/Cammin/LDtkToUnity/compare/6.12.2...6.12.3) (2026-04-10)
2+
3+
4+
### Bug Fixes
5+
6+
* Tweaked the Iid FindObjectsByType so Unity 6.4+ won't throw a warning ([42d896c](https://github.com/Cammin/LDtkToUnity/commit/42d896cf7cd94acd55c037fe2727f076e21ca843))
7+
8+
9+
### Performance Improvements
10+
11+
* Set all importers to AllowCaching so that it may potentially work with parallel importing better ([9d44ddc](https://github.com/Cammin/LDtkToUnity/commit/9d44ddc4e8df8180baf6f62d8aeabc56f9ba6411))
12+
13+
## [6.12.2](https://github.com/Cammin/LDtkToUnity/compare/6.12.1...6.12.2) (2026-03-23)
14+
15+
16+
### Bug Fixes
17+
18+
* Fixed issue where a level component's iid component reference was assigned a previous layer ([bf953f1](https://github.com/Cammin/LDtkToUnity/commit/bf953f13ad92e7da454aead249ab605a1e2b290f))
19+
20+
## [6.12.1](https://github.com/Cammin/LDtkToUnity/compare/6.12.0...6.12.1) (2026-01-25)
21+
22+
23+
### Bug Fixes
24+
25+
* Fixed a compile error in unity versions 2020 and before ([a12ebb4](https://github.com/Cammin/LDtkToUnity/commit/a12ebb44a513dc7a20bd3b3517b6c90c41dcf2e6))
26+
27+
# [6.12.0](https://github.com/Cammin/LDtkToUnity/compare/6.11.5...6.12.0) (2025-12-17)
28+
29+
30+
### Features
31+
32+
* Added layer sorting option ([6e96315](https://github.com/Cammin/LDtkToUnity/commit/6e963156aa75115e0c1df488ea1924dcdd9fdfcc))
33+
34+
## [6.11.5](https://github.com/Cammin/LDtkToUnity/compare/6.11.4...6.11.5) (2025-12-09)
35+
36+
37+
### Bug Fixes
38+
39+
* Disabled a .ldtkc import attempt that Unity does not encourage. Also prevents it's related warning which appears in 6000.3 ([bede8be](https://github.com/Cammin/LDtkToUnity/commit/bede8be19aa6dbbc13870b3ace9589609a4bbbc9))
40+
41+
## [6.11.4](https://github.com/Cammin/LDtkToUnity/compare/6.11.3...6.11.4) (2025-11-27)
42+
43+
44+
### Bug Fixes
45+
46+
* Fixed warnings related to TreeView that would appear in Unity 6000.2 ([5609f76](https://github.com/Cammin/LDtkToUnity/commit/5609f76a28b73f7be4a45309a9b96cd569847f34))
47+
48+
## [6.11.3](https://github.com/Cammin/LDtkToUnity/compare/6.11.2...6.11.3) (2025-11-26)
49+
50+
51+
### Bug Fixes
52+
53+
* ScaleEntities now properly reimports separate levels when changed ([90b69be](https://github.com/Cammin/LDtkToUnity/commit/90b69be430b13e3192789826d6d44d72fb65d9c5))
54+
55+
## [6.11.2](https://github.com/Cammin/LDtkToUnity/compare/6.11.1...6.11.2) (2025-07-30)
56+
57+
58+
### Bug Fixes
59+
60+
* Removed the check for EditorSettings.defaultBehaviorMode ([9937f39](https://github.com/Cammin/LDtkToUnity/commit/9937f3924e108280c8067a705ff0ddd5b82ea122))
61+
62+
## [6.11.1](https://github.com/Cammin/LDtkToUnity/compare/6.11.0...6.11.1) (2025-07-27)
63+
64+
65+
### Bug Fixes
66+
67+
* Fixed entities accidentally having a z scale of 0 ([0a01a78](https://github.com/Cammin/LDtkToUnity/commit/0a01a78b9db6465f8ad84a68ea0ebd9ade46c7ce))
68+
* Made a function in LDtkField internal instead of public ([be5130b](https://github.com/Cammin/LDtkToUnity/commit/be5130bac3150d2aff4677ff8921a575c0b995d5))
69+
170
# [6.11.0](https://github.com/Cammin/LDtkToUnity/compare/6.10.0...6.11.0) (2025-05-16)
271

372

Assets/LDtkUnity/Editor/Builders/LDtkBuilderEntity.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public LDtkBuilderEntity(LDtkProjectImporter project, Level level, LDtkComponent
2424

2525
public LDtkComponentEntity[] BuildEntityLayerInstances()
2626
{
27-
SortingOrder.Next();
27+
SortingOrder.Next(Layer.Identifier);
2828

2929
LDtkFieldParser.CacheRecentBuilder(this);
3030

@@ -125,7 +125,8 @@ private void ScaleEntity()
125125

126126
//modify by the resized entity scaling from LDtk
127127
Vector3 newScale = _entityObj.transform.localScale;
128-
newScale.Scale(_entityComponent.ScaleFactor);
128+
newScale.x *= _entityComponent.ScaleFactor.x;
129+
newScale.y *= _entityComponent.ScaleFactor.y;
129130
_entityObj.transform.localScale = newScale;
130131
}
131132

Assets/LDtkUnity/Editor/Builders/LDtkBuilderIntGridValue.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public LDtkBuilderIntGridValue(LDtkProjectImporter importer, Level level, LDtkCo
1717
public void BuildIntGridValues()
1818
{
1919
RoundTilemapPos();
20-
SortingOrder.Next();
20+
SortingOrder.Next(Layer.Identifier);
2121

2222
LayerDefinition layerDef = Layer.Definition;
2323
IntGridValueDefinition[] intGridValueDefs = layerDef.IntGridValues;

Assets/LDtkUnity/Editor/Builders/LDtkBuilderLevel.cs

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using UnityEngine;
1+
using System.Collections.Generic;
2+
using UnityEngine;
23

34
namespace LDtkUnity.Editor
45
{
@@ -21,6 +22,7 @@ internal sealed class LDtkBuilderLevel
2122
private LDtkComponentLayer[] _layerComponents;
2223
private MonoBehaviour[] _components;
2324

25+
private LDtkIid _layerIidComponent;
2426
private GameObject _layerGameObject;
2527
private LDtkComponentLayer _layerComponent;
2628
private LDtkComponentLayerParallax _parallax;
@@ -102,8 +104,8 @@ private void BuildLevelProcess()
102104
AddIidComponent();
103105
LDtkProfiler.EndSample();
104106

105-
LDtkProfiler.BeginSample("new LDtkSortingOrder");
106-
_sortingOrder = new LDtkSortingOrder();
107+
LDtkProfiler.BeginSample("LDtkSortingOrder");
108+
CreateSortingOrder();
107109
LDtkProfiler.EndSample();
108110

109111
LDtkProfiler.BeginSample("BuildLayerInstances");
@@ -131,6 +133,24 @@ private void BuildLevelProcess()
131133
LDtkProfiler.EndSample();
132134
}
133135

136+
private void CreateSortingOrder()
137+
{
138+
var orders = _project.LayerCustomSortingOrders;
139+
140+
if (!_project.UseLayerCustomSortingOrders || orders.IsNullOrEmpty())
141+
{
142+
_sortingOrder = new LDtkSortingOrder();
143+
return;
144+
}
145+
146+
var sortingOrders = new Dictionary<string, int>(orders.Length);
147+
foreach (LDtkLayerCustomSortingOrder order in orders)
148+
{
149+
sortingOrders.Add(order._ldtkLayerName, order._ldtkLayerOrder);
150+
}
151+
_sortingOrder = new LDtkSortingOrder(sortingOrders);
152+
}
153+
134154
private void BuildFields()
135155
{
136156
bool addedFields = TryAddFields();
@@ -150,8 +170,8 @@ private void BuildFields()
150170

151171
private void AddIidComponent()
152172
{
153-
LDtkIid iid = _levelGameObject.AddComponent<LDtkIid>();
154-
iid.SetIid(_level);
173+
_iidComponent = _levelGameObject.AddComponent<LDtkIid>();
174+
_iidComponent.SetIid(_level);
155175
}
156176

157177
private GameObject CreateLevelGameObject()
@@ -272,8 +292,8 @@ void TryBuildLayerGameObject()
272292
_parallax = _layerGameObject.AddComponent<LDtkComponentLayerParallax>();
273293
}
274294

275-
_iidComponent = _layerGameObject.AddComponent<LDtkIid>();
276-
_iidComponent.SetIid(layer);
295+
_layerIidComponent = _layerGameObject.AddComponent<LDtkIid>();
296+
_layerIidComponent.SetIid(layer);
277297

278298
builtLayer = true;
279299
}
@@ -323,7 +343,7 @@ void TryPopulateLayerComponent(ref bool populated)
323343
}
324344

325345
//now that everything is gathered, do the special OnImport and populate that component
326-
_layerComponent.OnImport(_importer.DefinitionObjects, layer, _levelComponent, _iidComponent, entities, _layerIntGrid, _layerTiles, layerScale);
346+
_layerComponent.OnImport(_importer.DefinitionObjects, layer, _levelComponent, _layerIidComponent, entities, _layerIntGrid, _layerTiles, layerScale);
327347
if (_project.UseParallax)
328348
{
329349
Vector2 halfLvlSize = (Vector2)_level.UnityPxSize / _project.PixelsPerUnit * 0.5f;

Assets/LDtkUnity/Editor/Builders/LDtkBuilderTileset.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public LDtkBuilderTileset(LDtkProjectImporter project, Level level, LDtkComponen
2121

2222
private void ConstructNewTilemap()
2323
{
24-
SortingOrder.Next();
24+
SortingOrder.Next(Layer.Identifier);
2525

2626
string tilemapName = Layer.IsTilesLayer ? "Tiles" : "AutoLayer";
2727

Assets/LDtkUnity/Editor/Builders/LDtkSortingOrder.cs

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,36 @@
1-
namespace LDtkUnity.Editor
1+
using System.Collections.Generic;
2+
3+
namespace LDtkUnity.Editor
24
{
5+
/// <summary>
6+
/// Increments for each occurrence of a tilemap or entity when building layers to ensure everything is layered correctly.
7+
/// This can be overridden to jump to custom-set sorting order numbers if needed.
8+
/// </summary>
39
internal sealed class LDtkSortingOrder
410
{
511
public int SortingOrderValue { get; private set; } = 0;
12+
private readonly Dictionary<string, int> _layerNameOverrides;
13+
private readonly HashSet<string> _layerNameOccurrences = new HashSet<string>();
614

7-
public void Next()
15+
public LDtkSortingOrder(Dictionary<string, int> layerNameOverrides = null)
16+
{
17+
_layerNameOverrides = layerNameOverrides;
18+
}
19+
20+
public void Next(string layerIdentifier = null)
821
{
22+
//note: this supports repeated layer occurrences, even if that never happens.
23+
24+
//Jump to the custom order if we get the first occurrence of a layer
25+
if (layerIdentifier != null && _layerNameOccurrences.Add(layerIdentifier))
26+
{
27+
if (_layerNameOverrides != null && _layerNameOverrides.TryGetValue(layerIdentifier, out int order))
28+
{
29+
SortingOrderValue = order;
30+
return;
31+
}
32+
}
33+
934
SortingOrderValue--;
1035
}
1136
}

Assets/LDtkUnity/Editor/Builders/TileChangeData.cs.meta

Lines changed: 10 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/LDtkUnity/Editor/CustomEditor/Importer/LDtkConfigImporterEditor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public override void OnInspectorGUI()
1616
{
1717
const string msg = "This file is generated by the project importer.\n" +
1818
"It contains the configuration data from the project inspector.\n" +
19-
"It is only used for telling the levels to reimport when this is changed.";
19+
"It is only used for telling separate levels to reimport when this has different values.";
2020
EditorGUILayout.HelpBox(msg, MessageType.Info);
2121
ApplyRevertGUI();
2222
}

0 commit comments

Comments
 (0)