17
的路径,当我测试它移动的Xcode的属性窗口,它看起来像这样:使粒子跟随我创建了一个粒子在spriteKit
我加入这个粒子场景,做了一个圆圈,并迫使粒子运行该圆:
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; – DogCoffee
嗨@SpaceDog,介意帮助我吗? http://stackoverflow.com/questions/29382541/couldnt-make-a-particle-follow-a-path-in-spritekit – user1872384