ログでこの例外が発生しています
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'CCSprite is not using the same texture id'
私がやろうとしているのは、通常の「myfile.png」ファイルをSpriteBatchNode
**バッチノードの宣言
CCSpriteBatchNode *_backgroundLayer = [CCSpriteBatchNode batchNodeWithFile:@"sprites.png"];
** 利用方法
このラインは完璧に機能します
CCSprite *sprite1 = [CCSprite spriteWithSpriteFrameName:@"PngFileKeptInSpriteSheet.png"];
[_backgroundLayer addChild:sprite1];
しかし、直接 *.png ファイルを使用してバッチ ノードに追加すると、クラッシュします。
CCSprite *sprite2 = [CCSprite spriteWithFile:@"myfile.png"];
オンラインでクラッシュする
[_backgroundLayer addChild:sprite2];
さらにデバッグすると、次のことがわかりました。
アサーションの失敗はファイルにありますCCSpriteBatchNode.m
内部メソッド-(void) addChild:(CCSprite*)child z:(NSInteger)z tag:(NSInteger) aTag
行でNSAssert( child.texture.name == textureAtlas_.texture.name, @"CCSprite is not using the same texture id");
PS:「通常」とは、* .plistファイルから取得されていないことを意味します