07 June 2015
Hi there! Tiled2Unity is no longer in development nor supported. Use SuperTiled2Unity to import Tiled Map Editor maps into your Unity projects instead.
Version 0.9.11.0 of Tiled2Unity has just been added to the Tiled2Unity Download Page. This build contains a couple of new features for power-users.
I had originally hardcoded all the scripts that build a prefab from Tiled2Unity to exist at the Assets/Tiled2Unity
directory. However, many developers prefer to gather all third-party libraries in a common location and I totally can’t blame them for wanting to put Tiled2Unity in a location like Assets/Scripts/ThirdParty/Tiled2Unity
along with everything else. That is now supported with the latest build of Tiled2Unity.
One caveat: I had to change the way the Tiled2Unity exporter is made aware of your Unity project in order to export the right files to the right location. You will now have to explicitly select your Tiled2Unity scripts location in your Unity project instead of just selecting the project root folder. This is done by finding the Assets/Your/Path/To/Tiled2Unity/Tiled2Unity.export.txt
file in your Unity project.
Each install of Tiled2Unity in Unity contains an export marker file that must be selected as the export destination.
This is just a tiny bit more complicated than earlier builds of Tiled2Unity but I think the trade-off is worth it. Tiled2Unity will remember your last export destination so you won’t have to select this every time you export a Tiled map into your project.
Most Tiled2Unity users will simply drop a Tiled2Unity generated prefab into their scene but some developers may want to instantiate a map prefab through script. However, Unity forces developers to place such assets in a Resources
folder. This meant users would need to export a Tiled map into Unity then move the generated prefab into another folder by hand — which breaks automation.
With the latest version of Tiled2Unity you can mark a Tiled map with the unity:resource
property like so …
Normally, Tiled map prefabs are constructed in the .../Tiled2Unity/Prefabs
folder but with the unity:resource
property they will reside in .../Tiled2Unity/Prefabs/Resources
instead. With this you can easily instantiate the prefab in realtime via a Unity script, for example …
using System.Collections;
public class MapCreator : MonoBehaviour
{
void Start()
{
UnityEngine.Object prefab = Resources.Load("MyTiledMapPrefab");
GameObject.Instantiate(prefab);
}
}
Developers employing some kind of procedural generated content scheme should find that useful.
With this latest build I have gone through and removed all dependencies on unmanaged Win32 code (the old export dialog was a big offender). The Tiled2Unity exporter still doesn’t officially support any non-Windows platform but people wanting to make Mac or Linux versions run via Mono should have an easier time at it now.