Hello
Guest
Home
Help
Search
Login
Register
2D Toolkit Forum
»
2D Toolkit
»
Support
»
how to optimize long TileMap?
« previous
next »
Print
Pages: [
1
]
Author
Topic: how to optimize long TileMap? (Read 4625 times)
stevexu
Newbie
Posts: 29
how to optimize long TileMap?
«
on:
October 16, 2013, 03:52:44 pm »
I have a long tilemap, in which I set a prefab for the tile "brick", so there are so many bricks in the sense, the brick play animator by using tk2dSpriteAnimator, but the performance is poor on some android mobile device, So how can i optimize it?
Logged
unikronsoftware
Administrator
Hero Member
Posts: 9709
Re: how to optimize long TileMap?
«
Reply #1 on:
October 16, 2013, 04:10:51 pm »
If you have many animated sprites spawned using prefabs, consider turning off the animator when its not visible. Check tk2dTileMapDemoCoin for an example. If that isnt enough, you'll have to do other things to optimize this, for example turning off tilemap chunks when not visible.
Logged
stevexu
Newbie
Posts: 29
Re: how to optimize long TileMap?
«
Reply #2 on:
October 16, 2013, 04:26:17 pm »
Thanks ! But How to turning off tilemap chunks when not visible? some code?
Logged
unikronsoftware
Administrator
Hero Member
Posts: 9709
Re: how to optimize long TileMap?
«
Reply #3 on:
October 16, 2013, 04:44:24 pm »
I wouldn't go that far unless absolutely necessary.
tilemap.Layers
.GetChunk(x, y) will return the chunk
SpriteChunk.gameObject = the game object for the chunk, which you can SetActive to turn on and off.
Logged
Print
Pages: [
1
]
« previous
next »
2D Toolkit Forum
»
2D Toolkit
»
Support
»
how to optimize long TileMap?