Skip to content
This repository was archived by the owner on Mar 7, 2026. It is now read-only.
This repository was archived by the owner on Mar 7, 2026. It is now read-only.

feat: Implement Unity Tilemap adapter #1

@Bli-AIk

Description

@Bli-AIk

🔗 Is your feature request related to a specific issue?

The core library Lunar.Core.Base defines an abstract TilemapBase class intended for Tiled integration, but there is no concrete implementation for the Unity engine. This prevents the framework from rendering or interacting with Tiled maps inside Unity, making the core feature unusable in a Unity environment.


💡 Feature Description

  • Expected outcome or effect: A concrete implementation of TilemapBase that works as a Unity adapter for Tiled maps. This will allow the Lunar framework to load and display maps exported from Tiled within Unity.
  • Specific implementation ideas, such as classes, methods, parameters, or API design:
    • Provide a Unity-side adapter that inherits from TilemapBase.
    • The adapter should interpret Tiled map data and map it onto Unity’s tile rendering system.
    • Core methods like tile retrieval, placement, and layer handling should delegate to Unity APIs internally.
  • Usage scenarios or benefits: Enables seamless use of Tiled editor maps inside Unity while still programming against the abstract Lunar.Core interfaces. Developers can design levels in Tiled and then load them directly in Unity without writing their own importer or renderer.
  • Engine-specific context: Works in both Editor and Play mode. Targets all platforms supported by Unity. Compatible with Mono and IL2CPP scripting backends.
  • Engine name & version: Unity 2021.3 LTS or later.

⚖ Alternatives Considered

  • Custom tilemap renderer: We considered creating a fully custom renderer using sprites or meshes. This approach was rejected because Unity already provides an efficient 2D Tilemap system, and the main challenge is adapting Tiled data—not reimplementing rendering logic.

📝 Additional Information

  • Example Usage: A TiledMapLoader from the Lunar project could parse a Tiled .tmx map file and then instantiate a prefab. This prefab would contain a Grid object with a child Tilemap that has the UnityTiledTilemapAdapter component attached. The loader would then interact with the adapter via its TilemapBase interface to populate tiles according to the Tiled map data.

See Lunar.Core.Base#1

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

Status

Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions