我尝试将一个CCParticleSystemQuad
作为孩子添加到LHSprite
:
player = [loader spriteWithUniqueName:@"player"];
NSAssert(player != nil, @"Couldn't find the player!");
// Particles
smokeParticles = [CCParticleSystemQuad particleWithFile:@"smoke.plist"];
smokeParticles.position = ccp(-30.0, 0.0);
[player addChild:smokeParticles];
但我不断收到此错误消息:
2012-12-29 22:51:44.373 MyProject[15396:15203]
*** Assertion failure in -[LHSprite addChild:z:tag:],
/MyPath/MyProject/libs/cocos2d/CCSprite.m:567
添加CCParticleSystemQuad
到CCLayer
[self addChild:smokeParticles];
工作得很好。
CCSprite.m
: 567 行
NSAssert([child isKindOfClass:[CCSprite class]],
@"CCSprite only supports CCSprites as children when using CCSpriteBatchNode");
谁能告诉我为什么会这样?