2D Toolkit Forum
2D Toolkit => Support => Topic started by: stevexu 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?
-
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.
-
Thanks ! But How to turning off tilemap chunks when not visible? some code?
-
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.