Hierarchy, Definitions and Components
The imported project generates a hierarchy of GameObjects with accompanying scripts for the json hierarchy.
- Project Root
- Worlds
- Levels
- Layers
- Entity/Tilemap GameObjects
- Layers
- Levels
- Worlds
In addition, ScriptableObjects are generated for every definition in the project, and referenced by the appropriate components.
The whole hierarchy of components and definitions (almost) match the structure of the json, whether instance or definition
Some alterations were made from the original json data for better ease of use in Unity:
- X/Y values into
Vector2
orVector2Int
- Color string/int into the
Color
struct - Definition uid references into its definition ScriptableObject references
- Tileset rectangles into it's sliced Sprite
- Some component's fields are changed to reference other components instead, like the level's layers array.
LDtkFields
have definition object references and can be accessed fromLDtkFields.GetDefinition
Components
LDtkComponentProject
LDtkComponentWorld
LDtkComponentLevel
LDtkComponentLayer
LDtkComponentEntity
LDtkComponentLayerIntGridValues
Scripting Reference
This component contains data to infer tilemap positions with IntGrid values.
LDtkComponentLayerTilesetTiles
Scripting Reference
This component contains some helper functions to work with the potential of several tilemaps.
LDtkComponentLayerParallax
Scripting Reference
This component aims to match exactly what is presented in the LDtk editor if layer parallax options are utilized.