2D Toolkit Forum
2D Toolkit => Support => Topic started by: maaton on November 11, 2014, 10:56:46 pm
-
Hi.
first of all I must say, 2dtoolkit tile map is simply awsome and it is a delight to use it. One question:
Every time I update the map and use SetTile() all tiles that have prefabs attached to them are instantiated again and Start() is called again on their script.
Is there a way to somehow "detach" all prefabs at runtime after I don't need them anymore? I use SetTile() quite often and I just couldn't figure this one out.
Thank you for your help in advance!
Marton
-
Easiest way is to keep all the prefab related stuff in one layer, tk2d only rebuilds changed layers. Alternatively I can get you a patch that will not spawn prefabs at runtime, there's no way to reliably keep track of prefabs at runtime so tk2d just doesn't do it.
-
I need to update both layers at the same time so I think I'll just put extra copies of the associated tiles to the tilesheet, one with prefab, one without.
Anyway,
thanks for your promt reply and great support!