gpt4 book ai didi

animation - SpriteKit : run code or block when action removed?

转载 作者:行者123 更新时间:2023-12-02 23:20:04 25 4
gpt4 key购买 nike

The run function for SKNode 允许您在操作完成时运行一个 block ,但是如果通过 removeAllActions 取消/删除操作怎么办?

取消操作不会从 run 函数调用完成 block 。

取消/删除操作时是否有回调或运行代码的方法?

最佳答案

是的,如果您在操作完成之前将其删除,则完成 block 将不会运行。每个文档:

The run(:completion:) method is identical to the run(:) method, but after the action completes, your block is called. This callback is only called if the action runs to completion. If the action is removed before it completes, the completion handler is never called.

关于animation - SpriteKit : run code or block when action removed?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44532198/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com