SpriteKit 中的粒子没有出现在 iPhone 模拟器上

Particle in SpriteKit does not appear on iPhone simulator

我正在使用此代码添加粒子:

NSString *explosionPath = [[NSBundle mainBundle] pathForResource:@"Explosion" ofType:@"sks"];
SKEmitterNode *explosion = [NSKeyedUnarchiver unarchiveObjectWithFile:explosionPath];
explosion.position = position;
[self addChild:explosion];

[explosion runAction:[SKAction waitForDuration:2.0] completion:^{
    [explosion removeFromParent];
}];

我的粒子就像爆炸的火一样,粒子在精灵编辑器中看起来不错。

当运行我的游戏在IOS模拟器上时,当爆炸应该出现时,屏幕上什么也没有出现,但是节点数增加了大约200-300个节点。

屏幕上没有任何火焰出现。

有任何 "view" 层次结构吗?

如果添加发射器后节点数增加,很可能它隐藏在另一个节点后面。尝试将发射器的 zPosition 设置为更高的值。

explosion.zPosition = 900; // you can go even higher than 900 if needed