This is a step by step tutorial on how to display a map in Unity
that was created in Tiled. We will go through the TMX(Tile Map XML)
file format. I will show you how to use XML serialization to load in the
TMX file format. We will then create and editor script to display the
contents of the map in the inspector to include a preview of the map. We
will then create an Editor script to import a new tmx file into your
Unity project, this script will import the textures used for your map
into your project in a folder that you choose. We will then create a
script to display your Tiled Map in Unity itself and can be used in your
Unity Game. Then we will convert our 2D map into a 3D map. Initially we
will only work with displaying a map with the Orientation set to
Orthogonal, the concepts for display a Hex, Isometric, and staggered
will be the same I will leave this for you to figure out on your own.
The code created in this project can be found on Get Hub
Tiled can be found at Get Tiled on itch.
This is a very good map editing program, with its own file format
called TMX(Tile Map XML). For more information on the tmx map format
refer to Tile Map Format. There are many importers out there already both paid and free Support-for-tmx-maps, scroll down the page until you come to the Unity 3D section. Tiled2Unity is a good free one, for more information see Tiled2Unity.
Tile Map XML Tutorial Index
Introduction
Initial Unity Setup
Tileset Textures
Tiled Maps
Tiled Map XML Loading in Unity
NUnit Testing
Tiled Map Format
No comments:
Post a Comment