这可能与粒子系统无关,但更多的是关于分层,但是...我有以下粒子系统的代码:
CCParticleExplosion *explosion = [[CCParticleExplosion alloc] init];
explosion.texture = [[CCTextureCache sharedTextureCache] addImage:@"blah.png"];
explosion.position = ccp(100,100);
[explosion setAutoRemoveOnFinish:YES];
[explosion setTotalParticles:10];
[self addChild:explosion];
[explosion autorelease];如果我像"HelloWorld“场景一样插入代码,它可以很好地呈现。但是,如果我将代码放在CCLayer下,并将该CCLayer添加到"HelloWorld“场景中,粒子就不会出现。为什么会这样呢?(我看到CCLayer还不错)
唯一值得注意的区别是,在我的"HelloWorld“场景中,我有一个"world”对象。我甚至尝试在我的CCLayer中添加[self scheduleUpdate]。
在我的CCLayer中,我也有一个空白更新。我是不是应该在这里做点什么?
-(void) update:(ccTime)delta{
}任何帮助,包括良好的一般实践(特别是内存管理)都将非常感谢。(刚刚开始使用cocos/iOS dev)谢谢!
发布于 2012-11-14 08:07:24
检查一下:
https://stackoverflow.com/questions/13367118
复制相似问题