我SKAction
以这种方式创建了我的:
unicornAction = [SKAction followPath:mypath asOffset:NO orientToPath:YES duration:0.1];
并将其添加到我的SKSprite
:
[sprite runAction:[SKAction repeatActionForever:unicornAction] withKey:@"move"];
我这样做是为了让我可以在精灵穿过路径的运动中随时调整速度。
当我的精灵到达路径的末尾时,我需要一个回调,以便我可以删除精灵。我怎样才能得到这样的回调?
另外,有没有更好的方法SKAction
来做我想做的事情,同时允许我在动作运行期间的任何地方改变速度?