Seanba / Tiled2Unity

Export Tiled Map Editor (TMX) files into Unity
Other
495 stars 120 forks source link

[Feature Request] Update Error Message in LoadObjectTypeXml #146

Open bqmackay opened 6 years ago

bqmackay commented 6 years ago

On my Mac, I'm trying to use the XML file created by Tiled as the input to Tiled2Unity, but I receive the following error:

Loading summary Succeeded: 1 Parsed: /Users/byron/Unity/Tiled/Maps/stOrigin.tmx Warnings: 0 Errors: 2 Error parsing Object Type Xml file: /Users/byron/Unity/Tiled/Maps/stOrigin.xml Object reference not set to an instance of an object Stack: at Tiled2Unity.TmxObjectTypes.FromXmlFile (System.String xmlPath) [0x00025] in <6883ba762f2b47a9a00ea12d8a51d00b>:0 at Tiled2Unity.TmxMap.LoadObjectTypeXml (System.String xmlPath) [0x00027] in <6883ba762f2b47a9a00ea12d8a51d00b>:0

I thought this error message meant I couldn't export my file to Unity. However, upon looking at the source code, I realized that the try-catch actually handles the error gracefully and the file is still exportable (which I validated in the application). I suggest updating the current error message saying that the file was still processed successfully, but with some errors (or something to that effect).