SuperTiled2Unity icon indicating copy to clipboard operation
SuperTiled2Unity copied to clipboard

Ignore Object import

Open Alkanov opened this issue 4 years ago • 3 comments

Hi,

Is there any way to ignore an Object during import? Here is why I want to do this:

I have a map that has objects that I use to trigger a slow debuff on the server, see screenshot:

image

The problem with this is that when I import this map into the client, it also imports tons of colliders that I dont want in the client because they wont be used at all. Then I tried the prefab replacement option like this:

image

But it is still importing the objects... I was able to use an "empty" gameobject/prefab and replace the Objects inside the IceSlow group but I still end up with tons of empty prefabs I dont want.

So Im wondering if there is a way to completely ignore an object? Or if this is classified as a bug because when I leave the object empty, it should do that = replace it with nothing

Alkanov avatar Apr 25 '20 13:04 Alkanov

Hi there, @Alkanov. Are all these objects on the same Object Layer in Tiled? You can add the unity:ignore custom attribute (make it a string with a value of True) to those Object Layers and they will be completely ignored by the import process. Note, however, that this may ignore other objects that you do want imported.

Seanba avatar Apr 25 '20 17:04 Seanba

Indeed this works for the client, but also makes it ignore for the server, if we could set the ignore flat on the Unity Editor (like what you already have under prefab settings) we could have one map with multiple export results

Alkanov avatar May 01 '20 11:05 Alkanov

Alright so I have modified the importer and successfully tested it. I left some debug lines to let people know whats going on when you set a Tiled Object Type but leave the game object part empty

https://github.com/Seanba/SuperTiled2Unity/pull/134

Alkanov avatar May 03 '20 11:05 Alkanov