动作数组中的布尔值 (swift)
Boolean in action array (swift)
我有一个动作数组,当这个数组完成后,我想将值移动到 false。
这是我的数组:
actionArray.addObject(SKAction.moveToY(hond.position.y + 0.4 * frame2.size.height, duration: timee/10))
actionArray.addObject(SKAction.moveToY(hond.position.y + 0.6 * frame2.size.height, duration: timee/12))
actionArray.addObject(SKAction.moveToY(hond.position.y + 0.7 * frame2.size.height, duration: timee/14))
actionArray.addObject(SKAction.moveToY(hond.position.y + 0.75 * frame2.size.height, duration: timee/16))
hond.runAction(SKAction.sequence(actionArray))
如何添加一个对象来更改布尔值添加数组的末尾?
SKAction Class Reference : http://goo.gl/zqqh5k
您可以使用 SKAction
中的 runBlock:
操作并将其添加到序列的末尾。
例如:
SKAction.runBlock(self.aFunction)
func aFunction() {
// Change your boolean value here
}
或:
SKAction.runBlock({ self.yourBooleanProperty = false })
我有一个动作数组,当这个数组完成后,我想将值移动到 false。
这是我的数组:
actionArray.addObject(SKAction.moveToY(hond.position.y + 0.4 * frame2.size.height, duration: timee/10))
actionArray.addObject(SKAction.moveToY(hond.position.y + 0.6 * frame2.size.height, duration: timee/12))
actionArray.addObject(SKAction.moveToY(hond.position.y + 0.7 * frame2.size.height, duration: timee/14))
actionArray.addObject(SKAction.moveToY(hond.position.y + 0.75 * frame2.size.height, duration: timee/16))
hond.runAction(SKAction.sequence(actionArray))
如何添加一个对象来更改布尔值添加数组的末尾?
SKAction Class Reference : http://goo.gl/zqqh5k
您可以使用 SKAction
中的 runBlock:
操作并将其添加到序列的末尾。
例如:
SKAction.runBlock(self.aFunction)
func aFunction() {
// Change your boolean value here
}
或:
SKAction.runBlock({ self.yourBooleanProperty = false })