Hello Guest

Author Topic: 2D toolkit incrasing performance  (Read 3944 times)

singh029

  • Newbie
  • *
  • Posts: 5
    • View Profile
2D toolkit incrasing performance
« on: April 15, 2014, 05:10:10 pm »
Hey! So i wanted to create multiple levels for my 2d platformer. The only thing i was afraid of was the performance on mobile devices.

Is there a way to turn off (setactive = false) the tiles in a tilemap when off screen?
i.e. Pooling
Is there a way to access each tile programmatically or would that cost too much?

Thank you!

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2D toolkit incrasing performance
« Reply #1 on: April 16, 2014, 10:19:17 am »
It shouldn't be necessary. tk2d splits up tile map into chunks, and unity will cull those chunks when out of screen. It doesn't deal with 1000s of game objects at a time, but merges 1024 tiles into 1 chunk by default.

singh029

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: 2D toolkit incrasing performance
« Reply #2 on: April 17, 2014, 10:18:03 pm »
Sweet! what if i set a prefab inside one of the tiles in the Data tab of the tilemap? do those also get culled?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2D toolkit incrasing performance
« Reply #3 on: April 18, 2014, 05:10:41 am »
They will get culled, but those should probably be turned off and on - check the tk2dTileMapDemoCoin code, it uses OnBecameInvisible, OnBecameVisible to turn off the animator when out of view