2D Toolkit Forum

2D Toolkit => Support => Topic started by: stevexu on October 16, 2013, 03:52:44 pm

Title: how to optimize long TileMap?
Post 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?
Title: Re: how to optimize long TileMap?
Post by: unikronsoftware 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.
Title: Re: how to optimize long TileMap?
Post by: stevexu on October 16, 2013, 04:26:17 pm
Thanks ! But How to  turning off tilemap chunks when not visible? some code?
Title: Re: how to optimize long TileMap?
Post by: unikronsoftware on October 16, 2013, 04:44:24 pm
I wouldn't go that far unless absolutely necessary.
tilemap.Layers
SpriteChunk.gameObject = the game object for the chunk, which you can SetActive to turn on and off.