【问题标题】:If an SKAction is removed, is the completion still run?如果一个 SKAction 被移除,完成是否仍然运行?
【发布时间】:2019-05-27 13:14:57
【问题描述】:

如标题所示,如果我使用sprite.removeAllActions() 删除一个动作,该动作的完成是否仍会运行?

这是一个基本的代码 sn-p 来帮助显示我的要求:

import SpriteKit

/// The action to add
let action = SKAction.moveBy(x: 10, y: 20, duration: 1.0)

/// The sprite to apply the action to
let sprite = SKSpriteNode(color: .white, size: CGSize(width: 50, height: 50))

// Run the action
sprite.run(action) {
    // Completion
    print("Completion")
}

【问题讨论】:

  • 你可以试试并告诉我们。
  • @E.Coms 我想我会的,因为我还没有收到答复。

标签: ios swift sprite-kit skaction completionhandler


【解决方案1】:

我只是在没有收到答案后快速测试了它。我发现如果操作已被删除,补全确实运行。

【讨论】:

  • 感谢您的努力。这是一个很好的问题和答案。
猜你喜欢
  • 2011-11-24
  • 1970-01-01
  • 2019-07-31
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-12-02
  • 2013-11-15
相关资源
最近更新 更多