【发布时间】:2013-09-24 15:39:29
【问题描述】:
我创建了一个粒子,当我在 Xcode 的属性窗口上测试它时,它看起来像这样:
我已将此粒子添加到场景中,制作了一个圆圈并使用以下命令强制粒子运行该圆圈:
NSString *myParticlePath = [[NSBundle mainBundle] pathForResource:@"particle" ofType:@"sks"];
SKEmitterNode *myParticle = [NSKeyedUnarchiver unarchiveObjectWithFile:myParticlePath];
[self addChild:myParticle];
CGPathRef circle = CGPathCreateWithEllipseInRect(CGRectMake(0,0,400,400), NULL);
SKAction *followTrack = [SKAction followPath:circle asOffset:NO orientToPath:YES duration:1.0];
SKAction *forever = [SKAction repeatActionForever:followTrack];
[myParticle runAction:forever];
这就是它的样子。就像一块白糖。节点粒子跟随路径,而不是生成的粒子。
我用虚线表示了一个圆圈,因此您可以看到它所遵循的路径...
有什么想法吗?
谢谢
【问题讨论】:
-
如果有人卡住,请尝试添加 myParticle.targetNode = self;
-
嗨@SpaceDog,介意帮助我吗? stackoverflow.com/questions/29382541/…
标签: ios iphone ipad sprite-kit skemitternode