Show / Hide Table of Contents

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

GameObject Hierarchy

In addition, ScriptableObjects are generated for every definition in the project, and referenced by the appropriate components.
DefinitionObjects

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 or Vector2Int
  • 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 from LDtkFields.GetDefinition

Components

LDtkComponentProject

Scripting Reference

LDtkComponentWorld

Scripting Reference

LDtkComponentLevel

Scripting Reference

LDtkComponentLayer

Scripting Reference

LDtkComponentEntity

Scripting Reference

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.

Definition Objects

LDtkDefinitionObjectLayer

Scripting Reference

LDtkDefinitionObjectEntity

Scripting Reference

LDtkDefinitionObjectTileset

Scripting Reference

LDtkDefinitionObjectField

Scripting Reference

LDtkDefinitionObjectEnum

Scripting Reference

LDtkDefinitionObjectAutoLayerRule

Scripting Reference

LDtkDefinitionObjectAutoLayerRuleGroup

Scripting Reference

  • Improve this Doc
In This Article
Back to top Generated by DocFX