Cammin / LDtkToUnity

Unity importer for the LDtk level editor
https://cammin.github.io/LDtkToUnity
MIT License
381 stars 38 forks source link

I need a feature(can set layer name in ldtk or in unity) #8

Closed bigtrizero closed 3 years ago

bigtrizero commented 3 years ago

I need a feature(can set layer name in ldtk and Convert to Unity or set layer name directly in unity)

The Layer will now be reset when rebuilding the project.

Please forgive me for my poor English。

Cammin commented 3 years ago

This sounds like a neat idea, to be able to transfer tags data from LDtk over to layers/entities.

I will explore some options when I get around to it and evaluate the best solution and explain it here.

In LDtk, there are tag options for entities, but not layers (I think), but I'll see what would be a good solution for entities, intgrid layers, and tile layers. 🙂

For layers, I may try adding layer mask options in the LDtk Project asset.

Cammin commented 3 years ago

To answer your question in the short term, there is an option to change what the default generated tilemap object is. image

Steps to make a custom prefab are here: https://github.com/Cammin/LDtkUnity/wiki/Tilemap-Grid-Prefab Your custom prefab would have the Tag/LayerMask changes :)

However this would affect all layers, so it may not be the exact solution you are looking for, but I'm planning to implement a feature where a Grid prefab can be set for every layer instead of all of them.

Cammin commented 3 years ago

Here's how it looks so far, sitting next to the layers in LDtk. image This should help out with many customizable options related to the prefab itself, like specifying different tags, layerMask, material/shader, physics material, or anything else. 👍

supertrizero commented 3 years ago

It works great! Thank you so much!

Cammin commented 3 years ago

I pushed the update with this feature. Hopefully, there are no bugs :) https://github.com/Cammin/LDtkUnity/blob/master/CHANGELOG.md