Hello
Guest
Home
Help
Search
Login
Register
2D Toolkit Forum
»
2D Toolkit
»
Support
»
Detach Prefab From Tiles at Runtime
« previous
next »
Print
Pages: [
1
]
Author
Topic: Detach Prefab From Tiles at Runtime (Read 4370 times)
maaton
2D Toolkit
Newbie
Posts: 4
Detach Prefab From Tiles at Runtime
«
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
Logged
unikronsoftware
Administrator
Hero Member
Posts: 9709
Re: Detach Prefab From Tiles at Runtime
«
Reply #1 on:
November 12, 2014, 10:17:19 am »
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.
Logged
maaton
2D Toolkit
Newbie
Posts: 4
Re: Detach Prefab From Tiles at Runtime
«
Reply #2 on:
November 12, 2014, 07:36:15 pm »
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!
Logged
Print
Pages: [
1
]
« previous
next »
2D Toolkit Forum
»
2D Toolkit
»
Support
»
Detach Prefab From Tiles at Runtime