0

我有这个 SKAction 序列:

    func move(){

    let recursive = SKAction.sequence([
        SKAction.moveByX(frame.size.width/2.8, y: 0, duration: NSTimeInterval(randomNumber())),
        SKAction.moveByX(-frame.size.width/2.8, y: 0, duration: NSTimeInterval(randomNumber())),
        SKAction.runBlock({self.move()})])
        doc.runAction(recursive, withKey: "move")
}

当下面的这部分运行时,我想更改节点的纹理属性,但我不知道如何将其添加到 SKAction 序列中。

SKAction.moveByX(frame.size.width/2.8, y: 0, duration: NSTimeInterval(randomNumber()))
4

1 回答 1

3

您可以添加另一个 runBlock 调用吗?

SKAction.runBlock(
{ 
      //change the texture and whatever else you need here...
      doc.texture = someNewTexture;
})
于 2015-06-21T18:02:39.987 回答