2D Toolkit Forum
2D Toolkit => Support => Topic started by: Christamin on November 07, 2012, 03:04:45 am
-
So let's just say I'm making an iPhone game,
If I were to to change the sprite id like this: sprite.spriteId = sprite.GetSpriteIdByName("PlatformSmall"); pretty often,
would this hinder the performance substantially?
-
Not massively, but you can always just cache the value and use it. Its just a couple lines more :)
int platformSmallSPriteId;
platformSmallSPriteId = sprite.GetSpriteIdByName("PlatformSmall");
...
sprite.spriteId = platformSmallSpriteId