有没有一种方法可以在对同一个Sprite运行其他动作的同时暂停SKSpriteNode中特定的动作?
Objective-C
[yourNode runAction:yourAction withKey:@"aKey"];
SKAction *action = [yourNode actionForKey:@"aKey"];
if(action){
action.speed = 0; //pause action
}
Swift
使用 key 运行一个操作:
yourNode.runAction(yourAction , withKey: "aKey")
if let action = ball.actionForKey("aKey"){
action.speed = 0
}