我应该在纹理工具包中的属性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; }
- 如何使用EVURLCache在PreCache中加载UIWebView
- 用于HLScaching的AVAssetDownloadDelegate方法未被调用
- 如何禁用Alamofire中的caching
- Alamofire Image:在af_setImageWithURL()之后从AutoPurgingImageCache获取图像
- 设置caching时间AFNetworking swift 2
- 一旦closures,从UIWebView释放内存/ cookie /caching
- 在Swift中的collectionViewCell中caching图像?
- 如何在UIWebview中保持login会话?
- 在本地存储数据IOS