我应该在纹理工具包中的属性caching纹理?

我在我的游戏中使用图像资源的地图集。 我使用SKTextureAtlas preloadTextureAtlases在我的游戏场景开始时预加载了所有的地图集,这在我开始使用时有了很大的改变。 这是我的问题:

我应该为每一个纹理创build一个属性,一次又一次地产生怪物或皮卡精灵? 或者是完全不必要的开销,因为我在我的游戏场景中预载我的图集?

下面是一个怪物类中的两个非常简单的例子。

caching纹理:

 - (id)initWithSize:(CGSize)size { if (self = [super init]) { SKTextureAtlas * atlas = [SKTextureAtlas atlasNamed:monsterAtlas]; self.monsterFighterTexture = [atlas textureNamed:@"monster-fighter"]; } return self; } - (Monster *)monster { Monster * monster = [Monster spriteNodeWithTexture:self.monsterFighterTexture]; return monster; } 

不要caching纹理。

 - (Monster *)monster { SKTextureAtlas * atlas = [SKTextureAtlas atlasNamed:monsterAtlas]; Monster * monster = [Monster spriteNodeWithTexture:[atlas textureNamed:@"monster-fighter"]]; return monster; }