ArgumentException: An element with the same key already exists in the dictionary. System.Collections.Generic.Dictionary

Create issue
Issue #48 open
Yashesh Chauhan created an issue

Basically I am facing this issue when I have open project which is having X-UniTMX package imported and when I am creating new project in which i am importing x-uniTMX. When I am trying to load map at that time I am facing this issue.

Below is more info about the issue.

ArgumentException: An element with the same key already exists in the dictionary. System.Collections.Generic.Dictionary2[System.Int32,X_UniTMX.Tile].Add (Int32 key, X_UniTMX.Tile value) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:404) X_UniTMX.Map.OnFinishedLoadingTileSet (X_UniTMX.TileSet tileSet) (at Assets/X-UniTMX/Code/Map.cs:807) X_UniTMX.TileSet.BuildTiles (Int32 mapTileWidth) (at Assets/X-UniTMX/Code/TileSet.cs:322) X_UniTMX.TileSet..ctor (TObject.Shared.NanoXMLNode node, System.String mapPath, X_UniTMX.Map map, Boolean isUsingStreamingPath, System.Action1 onFinishedLoadingTileSet, Int32 firstID) (at Assets/X-UniTMX/Code/TileSet.cs:265) X_UniTMX.Map.Initialize (TObject.Shared.NanoXMLDocument document) (at Assets/X-UniTMX/Code/Map.cs:748) X_UniTMX.Map..ctor (UnityEngine.TextAsset mapText, System.String mapPath, UnityEngine.GameObject parent, UnityEngine.Material baseTileMaterial, Int32 sortingOrder, System.Boolean[] makeUnique, System.Action`1 onMapFinishedLoading, Int32 tileObjectEllipsePrecision, Boolean simpleTileObjectCalculation, Double clipperArcTolerance, Double clipperMiterLimit, JoinType clipperJoinType, EndType clipperEndType, Single clipperDeltaOffset) (at Assets/X-UniTMX/Code/Map.cs:440) X_UniTMX.TiledMapComponent.LoadMap () (at Assets/X-UniTMX/Code/TiledMapComponent.cs:114) X_UniTMX.TiledMapComponent.Initialize () (at Assets/X-UniTMX/Code/TiledMapComponent.cs:94) X_UniTMX.TiledMapComponentEditor.DoImportMapButtonGUI () (at Assets/X-UniTMX/Editor/TiledMapComponentEditor.cs:129) X_UniTMX.TiledMapComponentEditor.OnInspectorGUI () (at Assets/X-UniTMX/Editor/TiledMapComponentEditor.cs:575) UnityEditor.InspectorWindow.DrawEditor (UnityEditor.Editor editor, Int32 editorIndex, Boolean forceDirty, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect, Boolean eyeDropperDirty) UnityEditor.DockArea:OnGUI()

Comments (6)

  1. Guilherme Augusto Almeida Filo Maia repo owner

    Okay, I must update the main branch ASAP... could you please try again, but using the trunkDev branch?

  2. Yashesh Chauhan reporter

    Hi,

    Thanks for providing the update.

    I have checked the trunkDev branch and I have not facing the same key issue.

    But I am facing many more issues. Below are the issues list.

    1) trunkDev’s code branch is only working on Unity5. I am not able to access it on Unity4.6.3.

    2) There are miss arrangement of objects issue in the map.

    ⁃   2.1) Here is the screen shot of the Map which I have imported into Unity5 using trunkDev branch : https://www.dropbox.com/s/z6y0c3stbx5cdqf/Unity5_screenshot.png?dl=0
      Note : Please see the objects which are in the blue color rectangle.
    
    ⁃   2.2) Here is the screen shot of the TiledMapEditor in which every object placed properly : https://www.dropbox.com/s/bdevseweokel7t6/TiledMapEditor_screenshot.png?dl=0
    

    Please look into the above issues.

    Thanks in Advance.

    Yashesh

  3. Guilherme Augusto Almeida Filo Maia repo owner

    whoa, this is really bad!

    could you please send me your map so I can check it here? Since I didn't see this problem with the example maps, there might be some config that is causing this.

    About Unity versions <5, I'm sorry for any incompatibility and will check this asap as well (I want the plugin to be 4.3+, or 4.5+ if 4.3 is not possible for some reason).

  4. Guilherme Augusto Almeida Filo Maia repo owner
    • changed status to open

    Something is really wrong in isometric projection!

    Also, the plugin should be 4.5+ at least

  5. Guilherme Augusto Almeida Filo Maia repo owner

    There was a small compatibility issue with the Config Editor script, fixed in c48e5f2

    And could you please send me your map so I can check it here? Since I didn't see this problem with the example maps, there might be some config that is causing this. You can send me through a direct message if you want.

  6. Yashesh Chauhan reporter

    Hi,

    I have send you a direct message along with my Map files. So please look into this and try to resolved this issue.

    Thanks Yashesh

  7. Log in to comment